-
Notifications
You must be signed in to change notification settings - Fork 46.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Don't clean up twice in hidden trees #24282
Conversation
@@ -2153,8 +2228,9 @@ function commitMutationEffects_begin(root: FiberRoot, lanes: Lanes) { | |||
if (deletions !== null) { | |||
for (let i = 0; i < deletions.length; i++) { | |||
const childToDelete = deletions[i]; | |||
const outermostHiddenFiber = findOutermostHiddenFiber(childToDelete); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This searches up to the root for each fiber in the deletion list. I don't know if there's a way to avoid this. We need to somehow know where we are in the tree before we start descending.
@@ -1980,7 +1980,6 @@ describe('ReactSuspenseEffectsSemantics', () => { | |||
|
|||
// Destroy layout and passive effects in the errored tree. | |||
'App destroy layout', | |||
'ThrowsInWillUnmount componentWillUnmount', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this was a bug since it was already earlier in the list. So removing it seems correct to me.
Comparing: af73043...01e3269 Critical size changesIncludes critical production bundles, as well as any change greater than 2%:
Significant size changesIncludes any change greater than 0.2%: Expand to show
|
Fixed in #24308 instead. |
Based on #24281
Fixes #24280. This is pretty invasive and likely subtly (or not so subtly) wrong.
Putting it out there for discussion on the approach.
Without whitespace
The idea is to track the "outermost hidden" Offscreen node during the commit traversal. We need to know the outermost one because it's the one that determines whether we're actually hidden or not. We need the fiber and not just the boolean because we need to know when on our way up to reset the state.