Skip to content
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

Make root.unmount() synchronous #22444

Merged
merged 2 commits into from
Sep 27, 2021
Merged

Make root.unmount() synchronous #22444

merged 2 commits into from
Sep 27, 2021

Commits on Sep 27, 2021

  1. Move flushSync warning to React DOM

    When you call in `flushSync` from an effect, React fires a warning. I've
    moved the implementation of this warning out of the reconciler and into
    React DOM.
    
    `flushSync` is a renderer API, not an isomorphic API, because it has
    behavior that was designed specifically for the constraints of React
    DOM. The equivalent API in a different renderer may not be the same.
    For example, React Native has a different threading model than the
    browser, so it might not make sense to expose a `flushSync` API to the
    JavaScript thread.
    acdlite committed Sep 27, 2021
    Configuration menu
    Copy the full SHA
    aa17cc2 View commit details
    Browse the repository at this point in the history
  2. Make root.unmount() synchronous

    When you unmount a root, the internal state that React stores on the
    DOM node is immediately cleared. So, we should also synchronously
    delete the React tree. You should be able to create a new root using
    the same container.
    acdlite committed Sep 27, 2021
    Configuration menu
    Copy the full SHA
    8cb21aa View commit details
    Browse the repository at this point in the history