File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed
packages/react-reconciler/src Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -1904,6 +1904,14 @@ function resetChildLanes(completedWork: Fiber) {
19041904 mergeLanes ( child . lanes , child . childLanes ) ,
19051905 ) ;
19061906
1907+ // Preserve passive static flag even in the case of a bailout;
1908+ // otherwise a subsequent unmount may bailout before calling destroy functions.
1909+ subtreeTag |= child . subtreeTag & PassiveStaticSubtreeTag ;
1910+ const effectTag = child . effectTag ;
1911+ if ( ( effectTag & PassiveStatic ) !== NoEffect ) {
1912+ subtreeTag |= PassiveStaticSubtreeTag ;
1913+ }
1914+
19071915 treeBaseDuration += child . treeBaseDuration ;
19081916 child = child . sibling ;
19091917 }
@@ -1928,9 +1936,19 @@ function resetChildLanes(completedWork: Fiber) {
19281936 mergeLanes ( child . lanes , child . childLanes ) ,
19291937 ) ;
19301938
1939+ // Preserve passive static flag even in the case of a bailout;
1940+ // otherwise a subsequent unmount may bailout before calling destroy functions.
1941+ subtreeTag |= child . subtreeTag & PassiveStaticSubtreeTag ;
1942+ const effectTag = child . effectTag ;
1943+ if ( ( effectTag & PassiveStatic ) !== NoEffect ) {
1944+ subtreeTag |= PassiveStaticSubtreeTag ;
1945+ }
1946+
19311947 child = child . sibling ;
19321948 }
19331949 }
1950+
1951+ completedWork . subtreeTag |= subtreeTag ;
19341952 }
19351953
19361954 completedWork . childLanes = newChildLanes ;
You can’t perform that action at this time.
0 commit comments