@@ -23,8 +23,12 @@ function storeStateUpdatesReducer(state, action) {
2323  return  [ action . payload ,  updateCount  +  1 ] 
2424} 
2525
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 ) 
2832} 
2933
3034function  captureWrapperProps ( 
@@ -402,7 +406,7 @@ export default function connectAdvanced(
402406      // We need this to execute synchronously every time we re-render. However, React warns 
403407      // about useLayoutEffect in SSR, so we try to detect environment and fall back to 
404408      // just useEffect instead to avoid the warning, since neither will run anyway. 
405-       useIsomorphicLayoutEffectWithArgs ( captureWrapperProps ,  undefined ,   [ 
409+       useIsomorphicLayoutEffectWithArgs ( captureWrapperProps ,  [ 
406410        lastWrapperProps , 
407411        lastChildProps , 
408412        renderIsScheduled , 
@@ -415,7 +419,6 @@ export default function connectAdvanced(
415419      // Our re-subscribe logic only runs when the store/subscription setup changes 
416420      useIsomorphicLayoutEffectWithArgs ( 
417421        subscribeUpdates , 
418-         [ store ,  subscription ,  childPropsSelector ] , 
419422        [ 
420423          shouldHandleStateChanges , 
421424          store , 
@@ -427,7 +430,8 @@ export default function connectAdvanced(
427430          childPropsFromStoreUpdate , 
428431          notifyNestedSubs , 
429432          forceComponentUpdateDispatch 
430-         ] 
433+         ] , 
434+         [ store ,  subscription ,  childPropsSelector ] 
431435      ) 
432436
433437      // Now that all that's done, we can finally try to actually render the child component. 
0 commit comments