-
Notifications
You must be signed in to change notification settings - Fork 47.3k
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 discard render phase state updates with the eager reducer optimization #14852
Conversation
Pushed a potential fix in 6f44db2. I don't really know if it's correct. It would really help to have a written description of how the eager optimization works and what assumptions it makes. |
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.
Good test cases
I wrote a partial description of how the optimization is supposed to work here. Maybe we can add more to it: react/packages/react-reconciler/src/ReactFiberHooks.js Lines 1094 to 1117 in 9b89187
Specifically, should add that |
…ization (facebook#14852) * Add test cases for setState(fn) + render phase updates * Update eager state and reducer for render phase updates * Fix a newly firing warning
## 16.8.2 => 16.8.3 ### React DOM * Fix a bug that caused inputs to behave incorrectly in UMD builds. ([@gaearon](https://github.com/gaearon) in [#14914](facebook/react#14914)) * Fix a bug that caused render phase updates to be discarded. ([@gaearon](https://github.com/gaearon) in [#14852](facebook/react#14852)) ### React DOM Server * Unwind the context stack when a stream is destroyed without completing, to prevent incorrect values during a subsequent render. ([@overlookmotel](https://github.com/overlookmotel) in [#14706](facebook/react#14706))
## 16.8.2 => 16.8.3 ### React DOM * Fix a bug that caused inputs to behave incorrectly in UMD builds. ([@gaearon](https://github.com/gaearon) in [#14914](facebook/react#14914)) * Fix a bug that caused render phase updates to be discarded. ([@gaearon](https://github.com/gaearon) in [#14852](facebook/react#14852)) ### React DOM Server * Unwind the context stack when a stream is destroyed without completing, to prevent incorrect values during a subsequent render. ([@overlookmotel](https://github.com/overlookmotel) in [#14706](facebook/react#14706))
Reproduces #14849 in 2 out of 3 cases (with hoisted reducer and useState but not with inline reducer). Points to a bug in eager update logic. Not sure where it is yet.