@@ -160,7 +160,7 @@ export type Effect = {
160160 tag : HookFlags ,
161161 create : ( ) => ( ( ) => void ) | void ,
162162 destroy : ( ( ) => void ) | void ,
163- deps : Array < mixed > | null ,
163+ deps : Array < mixed > | void | null ,
164164 next : Effect ,
165165} ;
166166
@@ -1539,7 +1539,7 @@ function updateStoreInstance<T>(
15391539 }
15401540}
15411541
1542- function subscribeToStore ( fiber , inst , subscribe ) {
1542+ function subscribeToStore < T > (fiber, inst: StoreInstance < T > , subscribe) {
15431543 const handleStoreChange = ( ) => {
15441544 // The store changed. Check if the snapshot changed since the last time we
15451545 // read from the store.
@@ -1552,7 +1552,7 @@ function subscribeToStore(fiber, inst, subscribe) {
15521552 return subscribe ( handleStoreChange ) ;
15531553}
15541554
1555- function checkIfSnapshotChanged(inst) {
1555+ function checkIfSnapshotChanged< T > (inst: StoreInstance < T > ): boolean {
15561556 const latestGetSnapshot = inst . getSnapshot ;
15571557 const prevValue = inst . value ;
15581558 try {
@@ -1609,7 +1609,7 @@ function rerenderState<S>(
16091609 return rerenderReducer ( basicStateReducer , ( initialState : any ) ) ;
16101610}
16111611
1612- function pushEffect(tag, create, destroy, deps) {
1612+ function pushEffect(tag, create, destroy, deps: Array < mixed > | void | null ) {
16131613 const effect : Effect = {
16141614 tag,
16151615 create,
@@ -1728,7 +1728,12 @@ function updateRef<T>(initialValue: T): {current: T} {
17281728 return hook . memoizedState ;
17291729}
17301730
1731- function mountEffectImpl(fiberFlags, hookFlags, create, deps): void {
1731+ function mountEffectImpl(
1732+ fiberFlags,
1733+ hookFlags,
1734+ create,
1735+ deps: Array< mixed > | void | null,
1736+ ): void {
17321737 const hook = mountWorkInProgressHook ( ) ;
17331738 const nextDeps = deps === undefined ? null : deps ;
17341739 currentlyRenderingFiber . flags |= fiberFlags ;
@@ -1740,7 +1745,12 @@ function mountEffectImpl(fiberFlags, hookFlags, create, deps): void {
17401745 ) ;
17411746}
17421747
1743- function updateEffectImpl(fiberFlags, hookFlags, create, deps): void {
1748+ function updateEffectImpl(
1749+ fiberFlags,
1750+ hookFlags,
1751+ create,
1752+ deps: Array< mixed > | void | null,
1753+ ): void {
17441754 const hook = updateWorkInProgressHook ( ) ;
17451755 const nextDeps = deps === undefined ? null : deps ;
17461756 let destroy = undefined ;
@@ -2395,7 +2405,7 @@ function entangleTransitionUpdate<S, A>(
23952405 }
23962406}
23972407
2398- function markUpdateInDevTools ( fiber , lane , action ) {
2408+ function markUpdateInDevTools < A > (fiber, lane, action: A ) {
23992409 if ( __DEV__ ) {
24002410 if ( enableDebugTracing ) {
24012411 if ( fiber . mode & DebugTracingMode ) {
@@ -2490,6 +2500,7 @@ const HooksDispatcherOnMount: Dispatcher = {
24902500if (enableCache) {
24912501 ( HooksDispatcherOnMount : Dispatcher ) . getCacheSignal = getCacheSignal ;
24922502 ( HooksDispatcherOnMount : Dispatcher ) . getCacheForType = getCacheForType ;
2503+ // $FlowFixMe[escaped-generic] discovered when updating Flow
24932504 ( HooksDispatcherOnMount : Dispatcher ) . useCacheRefresh = mountRefresh ;
24942505}
24952506if (enableUseHook) {
0 commit comments