You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Concurrent mode] Scheduled updates are lost when parent state update happens #17028
Do you want to request a feature or report a bug?
Probably a bug
What is the current behavior?
When in concurrent mode (render with unstable_createRoot), triggering a state change via an event (eg click) on the parent makes React loose the scheduled updates in the children. See:
Not an expert on concurrent mode here, was just playing around with it. Noticed that when some interactions happen the work (probably moved to the other tree) gets lost if the parent re-renders. You can see by clicking anywhere in the sandbox page vs clicking on the button that changes some local state. But that is just my educated guess on what might be happening.
What is the expected behavior?
State updates that are scheduled in children components should happen and the DOM value should reflect the state.
Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?
Activity
dai-shi commentedon Nov 23, 2019
👍 Linking my comment #16396 (comment). I thought it was an issue with use-subscription back then, but it turns out to be a broader issue.
dai-shi commentedon Jan 11, 2020
Hey, you might want to try with the latest experimental channel.
In my tool,
0.0.0-experimental-f42431abefixes some cases. But not all.acdlite commentedon Feb 21, 2020
Thanks for the bug report!
I believe this was fixed by #18091
You can confirm using
react@0.0.0-experimental-ea6ed3dbbandreact-dom@0.0.0-experimental-ea6ed3dbb.I'm going to close this issue, but if the bug persists please comment and we'll reopen.