@@ -350,7 +350,7 @@ const Dispatcher: DispatcherType = {
350350// create a proxy to throw a custom error
351351// in case future versions of React adds more hooks
352352const DispatcherProxyHandler = {
353- get ( target , prop ) {
353+ get ( target : DispatcherType , prop : string ) {
354354 if ( target . hasOwnProperty ( prop ) ) {
355355 return target [ prop ] ;
356356 }
@@ -404,7 +404,7 @@ export type HooksTree = Array<HooksNode>;
404404
405405let mostLikelyAncestorIndex = 0;
406406
407- function findSharedIndex(hookStack, rootStack, rootIndex) {
407+ function findSharedIndex(hookStack: any , rootStack: any , rootIndex: number ) {
408408 const source = rootStack [ rootIndex ] . source ;
409409 hookSearch : for ( let i = 0 ; i < hookStack . length ; i ++ ) {
410410 if ( hookStack [ i ] . source === source ) {
@@ -425,7 +425,7 @@ function findSharedIndex(hookStack, rootStack, rootIndex) {
425425 return - 1 ;
426426}
427427
428- function findCommonAncestorIndex(rootStack, hookStack) {
428+ function findCommonAncestorIndex(rootStack: any , hookStack: any ) {
429429 let rootIndex = findSharedIndex (
430430 hookStack ,
431431 rootStack ,
@@ -446,7 +446,7 @@ function findCommonAncestorIndex(rootStack, hookStack) {
446446 return - 1 ;
447447}
448448
449- function isReactWrapper ( functionName , primitiveName ) {
449+ function isReactWrapper ( functionName : any , primitiveName : string ) {
450450 if ( ! functionName ) {
451451 return false ;
452452 }
@@ -460,7 +460,7 @@ function isReactWrapper(functionName, primitiveName) {
460460 ) ;
461461}
462462
463- function findPrimitiveIndex ( hookStack , hook ) {
463+ function findPrimitiveIndex ( hookStack : any , hook : HookLogEntry ) {
464464 const stackCache = getPrimitiveStackCache ( ) ;
465465 const primitiveStack = stackCache . get ( hook . primitive ) ;
466466 if ( primitiveStack === undefined ) {
@@ -488,7 +488,7 @@ function findPrimitiveIndex(hookStack, hook) {
488488 return - 1 ;
489489}
490490
491- function parseTrimmedStack ( rootStack , hook ) {
491+ function parseTrimmedStack ( rootStack : any , hook : HookLogEntry ) {
492492 // Get the stack trace between the primitive hook function and
493493 // the root function call. I.e. the stack frames of custom hooks.
494494 const hookStack = ErrorStackParser . parse ( hook . stackError ) ;
@@ -520,8 +520,8 @@ function parseCustomHookName(functionName: void | string): string {
520520}
521521
522522function buildTree (
523- rootStack ,
524- readHookLog ,
523+ rootStack : any ,
524+ readHookLog : Array < HookLogEntry > ,
525525 includeHooksSource: boolean,
526526): HooksTree {
527527 const rootChildren = [ ] ;
@@ -764,7 +764,7 @@ function inspectHooksOfForwardRef<Props, Ref>(
764764 return buildTree(rootStack, readHookLog, includeHooksSource);
765765}
766766
767- function resolveDefaultProps ( Component , baseProps ) {
767+ function resolveDefaultProps ( Component : any , baseProps : any ) {
768768 if ( Component && Component . defaultProps ) {
769769 // Resolve default props. Taken from ReactElement
770770 const props = assign ( { } , baseProps ) ;
0 commit comments