Skip to content

[Concurrent mode] Scheduled updates are lost when parent state update happens #17028

@albertogasparin

Description

@albertogasparin

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:

https://codesandbox.io/s/react-concurrent-state-bug-sp6zq

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?

react: 16.10.2
react-dom: 16.10.2

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions