@@ -858,6 +858,7 @@ function commitNestedUnmounts(
858
858
}
859
859
860
860
function detachFiber ( current : Fiber ) {
861
+ const alternate = current . alternate ;
861
862
// Cut off the return pointers to disconnect it from the tree. Ideally, we
862
863
// should clear the child pointer of the parent alternate to let this
863
864
// get GC:ed but we don't know which for sure which parent is the current
@@ -868,13 +869,14 @@ function detachFiber(current: Fiber) {
868
869
current . memoizedState = null ;
869
870
current . updateQueue = null ;
870
871
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 ;
872
878
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 ) ;
878
880
}
879
881
}
880
882
0 commit comments