File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
packages/react-reconciler/src Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -2635,10 +2635,12 @@ function mountMemo<T>(
26352635): T {
26362636 const hook = mountWorkInProgressHook ( ) ;
26372637 const nextDeps = deps === undefined ? null : deps ;
2638+ const nextValue = nextCreate ( ) ;
26382639 if ( shouldDoubleInvokeUserFnsInHooksDEV ) {
2640+ setIsStrictModeForDevtools ( true ) ;
26392641 nextCreate ( ) ;
2642+ setIsStrictModeForDevtools ( false ) ;
26402643 }
2641- const nextValue = nextCreate ( ) ;
26422644 hook.memoizedState = [nextValue, nextDeps];
26432645 return nextValue;
26442646}
@@ -2657,10 +2659,12 @@ function updateMemo<T>(
26572659 return prevState [ 0 ] ;
26582660 }
26592661 }
2662+ const nextValue = nextCreate ( ) ;
26602663 if ( shouldDoubleInvokeUserFnsInHooksDEV ) {
2664+ setIsStrictModeForDevtools ( true ) ;
26612665 nextCreate ( ) ;
2666+ setIsStrictModeForDevtools ( false ) ;
26622667 }
2663- const nextValue = nextCreate ( ) ;
26642668 hook.memoizedState = [nextValue, nextDeps];
26652669 return nextValue;
26662670}
You can’t perform that action at this time.
0 commit comments