@@ -23,8 +23,12 @@ function storeStateUpdatesReducer(state, action) {
23
23
return [ action . payload , updateCount + 1 ]
24
24
}
25
25
26
- function useIsomorphicLayoutEffectWithArgs ( create , deps , args ) {
27
- useIsomorphicLayoutEffect ( ( ) => create ( ...args ) , deps )
26
+ function useIsomorphicLayoutEffectWithArgs (
27
+ effectFunc ,
28
+ effectArgs ,
29
+ dependencies
30
+ ) {
31
+ useIsomorphicLayoutEffect ( ( ) => effectFunc ( ...effectArgs ) , dependencies )
28
32
}
29
33
30
34
function captureWrapperProps (
@@ -402,7 +406,7 @@ export default function connectAdvanced(
402
406
// We need this to execute synchronously every time we re-render. However, React warns
403
407
// about useLayoutEffect in SSR, so we try to detect environment and fall back to
404
408
// just useEffect instead to avoid the warning, since neither will run anyway.
405
- useIsomorphicLayoutEffectWithArgs ( captureWrapperProps , undefined , [
409
+ useIsomorphicLayoutEffectWithArgs ( captureWrapperProps , [
406
410
lastWrapperProps ,
407
411
lastChildProps ,
408
412
renderIsScheduled ,
@@ -415,7 +419,6 @@ export default function connectAdvanced(
415
419
// Our re-subscribe logic only runs when the store/subscription setup changes
416
420
useIsomorphicLayoutEffectWithArgs (
417
421
subscribeUpdates ,
418
- [ store , subscription , childPropsSelector ] ,
419
422
[
420
423
shouldHandleStateChanges ,
421
424
store ,
@@ -427,7 +430,8 @@ export default function connectAdvanced(
427
430
childPropsFromStoreUpdate ,
428
431
notifyNestedSubs ,
429
432
forceComponentUpdateDispatch
430
- ]
433
+ ] ,
434
+ [ store , subscription , childPropsSelector ]
431
435
)
432
436
433
437
// Now that all that's done, we can finally try to actually render the child component.
0 commit comments