@@ -350,7 +350,7 @@ const Dispatcher: DispatcherType = {
350
350
// create a proxy to throw a custom error
351
351
// in case future versions of React adds more hooks
352
352
const DispatcherProxyHandler = {
353
- get ( target , prop ) {
353
+ get ( target : DispatcherType , prop : string ) {
354
354
if ( target . hasOwnProperty ( prop ) ) {
355
355
return target [ prop ] ;
356
356
}
@@ -404,7 +404,7 @@ export type HooksTree = Array<HooksNode>;
404
404
405
405
let mostLikelyAncestorIndex = 0;
406
406
407
- function findSharedIndex(hookStack, rootStack, rootIndex) {
407
+ function findSharedIndex(hookStack: any , rootStack: any , rootIndex: number ) {
408
408
const source = rootStack [ rootIndex ] . source ;
409
409
hookSearch : for ( let i = 0 ; i < hookStack . length ; i ++ ) {
410
410
if ( hookStack [ i ] . source === source ) {
@@ -425,7 +425,7 @@ function findSharedIndex(hookStack, rootStack, rootIndex) {
425
425
return - 1 ;
426
426
}
427
427
428
- function findCommonAncestorIndex(rootStack, hookStack) {
428
+ function findCommonAncestorIndex(rootStack: any , hookStack: any ) {
429
429
let rootIndex = findSharedIndex (
430
430
hookStack ,
431
431
rootStack ,
@@ -446,7 +446,7 @@ function findCommonAncestorIndex(rootStack, hookStack) {
446
446
return - 1 ;
447
447
}
448
448
449
- function isReactWrapper ( functionName , primitiveName ) {
449
+ function isReactWrapper ( functionName : any , primitiveName : string ) {
450
450
if ( ! functionName ) {
451
451
return false ;
452
452
}
@@ -460,7 +460,7 @@ function isReactWrapper(functionName, primitiveName) {
460
460
) ;
461
461
}
462
462
463
- function findPrimitiveIndex ( hookStack , hook ) {
463
+ function findPrimitiveIndex ( hookStack : any , hook : HookLogEntry ) {
464
464
const stackCache = getPrimitiveStackCache ( ) ;
465
465
const primitiveStack = stackCache . get ( hook . primitive ) ;
466
466
if ( primitiveStack === undefined ) {
@@ -488,7 +488,7 @@ function findPrimitiveIndex(hookStack, hook) {
488
488
return - 1 ;
489
489
}
490
490
491
- function parseTrimmedStack ( rootStack , hook ) {
491
+ function parseTrimmedStack ( rootStack : any , hook : HookLogEntry ) {
492
492
// Get the stack trace between the primitive hook function and
493
493
// the root function call. I.e. the stack frames of custom hooks.
494
494
const hookStack = ErrorStackParser . parse ( hook . stackError ) ;
@@ -520,8 +520,8 @@ function parseCustomHookName(functionName: void | string): string {
520
520
}
521
521
522
522
function buildTree (
523
- rootStack ,
524
- readHookLog ,
523
+ rootStack : any ,
524
+ readHookLog : Array < HookLogEntry > ,
525
525
includeHooksSource: boolean,
526
526
): HooksTree {
527
527
const rootChildren = [ ] ;
@@ -764,7 +764,7 @@ function inspectHooksOfForwardRef<Props, Ref>(
764
764
return buildTree(rootStack, readHookLog, includeHooksSource);
765
765
}
766
766
767
- function resolveDefaultProps ( Component , baseProps ) {
767
+ function resolveDefaultProps ( Component : any , baseProps : any ) {
768
768
if ( Component && Component . defaultProps ) {
769
769
// Resolve default props. Taken from ReactElement
770
770
const props = assign ( { } , baseProps ) ;
0 commit comments