@@ -893,6 +893,7 @@ function commitNestedUnmounts(
893
893
}
894
894
895
895
function detachFiber ( current : Fiber ) {
896
+ const alternate = current . alternate ;
896
897
// Cut off the return pointers to disconnect it from the tree. Ideally, we
897
898
// should clear the child pointer of the parent alternate to let this
898
899
// get GC:ed but we don't know which for sure which parent is the current
@@ -903,13 +904,14 @@ function detachFiber(current: Fiber) {
903
904
current . memoizedState = null ;
904
905
current . updateQueue = null ;
905
906
current . dependencies = null ;
906
- const alternate = current . alternate ;
907
+ current . sibling = null ;
908
+ current . alternate = null ;
909
+ current . firstEffect = null ;
910
+ current . lastEffect = null ;
911
+ current . pendingProps = null ;
912
+ current . memoizedProps = null ;
907
913
if ( alternate !== null ) {
908
- alternate . return = null ;
909
- alternate . child = null ;
910
- alternate . memoizedState = null ;
911
- alternate . updateQueue = null ;
912
- alternate . dependencies = null ;
914
+ detachFiber ( alternate ) ;
913
915
}
914
916
}
915
917
0 commit comments