-
Notifications
You must be signed in to change notification settings - Fork 49k
Fix form state reset when component state is updated #34075
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
base: main
Are you sure you want to change the base?
Conversation
Comparing: c260b38...9be8342 Critical size changesIncludes critical production bundles, as well as any change greater than 2%:
Significant size changesIncludes any change greater than 0.2%: (No significant changes) |
// This is intentionally set here instead of pushHostContext because | ||
// pushHostContext gets called before we process the state hook, to avoid | ||
// a state mismatch in the event that something suspends. |
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'm not sure I fully understand this comment. If something suspends we pop back up. And the Component we're rendering (here: TransitionAwareHostComponent
) should not be able to read the current Context just yet which is what pushing the context before the render would do, right? We can't nest Host Context anyway though. So this seems safe to move the push after the render.
b6348c2
to
77dc8cc
Compare
77dc8cc
to
9be8342
Compare
Alternate to #33351 without the regression highlighted in #33351 (comment)
Host context is now modelled like React context in that we set the value in
pushHostContext
instead of duringupdateHostComponent
. There was a comment explaining why that shouldn't work but I can't see why it would not work for Host context but normal context.Closes #30368
Closes #33351