File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed
packages/react-reconciler/src Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -1116,6 +1116,9 @@ function detachFiber(fiber: Fiber) {
1116
1116
// get GC:ed but we don't know which for sure which parent is the current
1117
1117
// one so we'll settle for GC:ing the subtree of this child. This child
1118
1118
// itself will be GC:ed when the parent updates the next time.
1119
+ // Note: we cannot null out sibling here, otherwise it can cause issues
1120
+ // with findDOMNode and how it requires the sibling field to carry out
1121
+ // traversal in a later effect. See PR #16820.
1119
1122
fiber . alternate = null ;
1120
1123
fiber . child = null ;
1121
1124
fiber . dependencies = null ;
@@ -1125,7 +1128,6 @@ function detachFiber(fiber: Fiber) {
1125
1128
fiber . memoizedState = null ;
1126
1129
fiber . pendingProps = null ;
1127
1130
fiber . return = null ;
1128
- fiber . sibling = null ;
1129
1131
fiber . stateNode = null ;
1130
1132
fiber . updateQueue = null ;
1131
1133
if ( __DEV__ ) {
Original file line number Diff line number Diff line change @@ -1116,6 +1116,9 @@ function detachFiber(fiber: Fiber) {
1116
1116
// get GC:ed but we don't know which for sure which parent is the current
1117
1117
// one so we'll settle for GC:ing the subtree of this child. This child
1118
1118
// itself will be GC:ed when the parent updates the next time.
1119
+ // Note: we cannot null out sibling here, otherwise it can cause issues
1120
+ // with findDOMNode and how it requires the sibling field to carry out
1121
+ // traversal in a later effect. See PR #16820.
1119
1122
fiber . alternate = null ;
1120
1123
fiber . child = null ;
1121
1124
fiber . dependencies = null ;
@@ -1125,7 +1128,6 @@ function detachFiber(fiber: Fiber) {
1125
1128
fiber . memoizedState = null ;
1126
1129
fiber . pendingProps = null ;
1127
1130
fiber . return = null ;
1128
- fiber . sibling = null ;
1129
1131
fiber . stateNode = null ;
1130
1132
fiber . updateQueue = null ;
1131
1133
if ( __DEV__ ) {
You can’t perform that action at this time.
0 commit comments