File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
packages/react-reconciler/src Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -726,11 +726,20 @@ function detachFiber(current: Fiber) {
726726 // get GC:ed but we don't know which for sure which parent is the current
727727 // one so we'll settle for GC:ing the subtree of this child. This child
728728 // itself will be GC:ed when the parent updates the next time.
729+ // We do not null out the 'nextEffect' field as it causes tests to fail.
729730 current . return = null ;
730731 current . child = null ;
732+ current . memoizedState = null ;
733+ current . updateQueue = null ;
734+ current . firstEffect = null ;
735+ current . lastEffect = null ;
731736 if ( current . alternate ) {
732- current . alternate . child = null ;
733737 current . alternate . return = null ;
738+ current . alternate . child = null ;
739+ current . alternate . memoizedState = null ;
740+ current . alternate . updateQueue = null ;
741+ current . alternate . firstEffect = null ;
742+ current . alternate . lastEffect = null ;
734743 }
735744}
736745
You can’t perform that action at this time.
0 commit comments