-
Notifications
You must be signed in to change notification settings - Fork 46.9k
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
Reset hydration state after reentering #16306
Conversation
We might reenter a hydration state, when attempting to hydrate a boundary. We need to ensure that we reset it to not hydrating once we exit it. Otherwise the next sibling will still be in hydration mode.
@@ -134,7 +139,6 @@ function unwindInterruptedWork(interruptedWork: Fiber) { | |||
break; | |||
case DehydratedSuspenseComponent: | |||
if (enableSuspenseServerRenderer) { | |||
// TODO: popHydrationState |
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 one is not needed since restarting the root covers it. I think anything covered by resetFreshStack also doesn't need to be here.
popSuspenseContext(workInProgress); | ||
if (workInProgress.alternate === null) { | ||
// TODO: popHydrationState |
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 can't actually do this yet because this because popping causes hydration warnings. This is part of a larger bug that suspending in a dehydrated tree can leave the hydration context in an inconsistent state when we move to work on the sibling of the thing that suspended. That's a bigger issue to fix.
ReactDOM: size: 0.0%, gzip: -0.0% Details of bundled changes.Comparing: 7c838a6...a9cc9a5 react-art
react-dom
react-test-renderer
react-reconciler
react-native-renderer
Generated by 🚫 dangerJS |
We might reenter a hydration state, when attempting to hydrate a boundary. We need to ensure that we reset it to not hydrating once we exit it. Otherwise the next sibling will still be in hydration mode.