@@ -858,6 +858,7 @@ function commitNestedUnmounts(
858858}
859859
860860function detachFiber ( current : Fiber ) {
861+ const alternate = current . alternate ;
861862 // Cut off the return pointers to disconnect it from the tree. Ideally, we
862863 // should clear the child pointer of the parent alternate to let this
863864 // get GC:ed but we don't know which for sure which parent is the current
@@ -868,13 +869,14 @@ function detachFiber(current: Fiber) {
868869 current . memoizedState = null ;
869870 current . updateQueue = null ;
870871 current . dependencies = null ;
871- const alternate = current . alternate ;
872+ current . sibling = null ;
873+ current . alternate = null ;
874+ current . firstEffect = null ;
875+ current . lastEffect = null ;
876+ current . pendingProps = null ;
877+ current . memoizedProps = null ;
872878 if ( alternate !== null ) {
873- alternate . return = null ;
874- alternate . child = null ;
875- alternate . memoizedState = null ;
876- alternate . updateQueue = null ;
877- alternate . dependencies = null ;
879+ detachFiber ( alternate ) ;
878880 }
879881}
880882
0 commit comments