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

Fix: flushSync changes priority inside effect #21122

Merged
merged 1 commit into from
Mar 28, 2021

Commits on Mar 28, 2021

  1. Fix: flushSync changes priority inside effect

    When called from inside an effect, flushSync cannot synchronously flush
    its updates because React is already working. So we fire a warning.
    
    However, we should still change the priority of the updates to sync so
    that they flush at the end of the current task.
    
    This only affects useEffect because updates inside useLayoutEffect (and
    the rest of the commit phase, like ref callbacks) are already sync.
    acdlite committed Mar 28, 2021
    Configuration menu
    Copy the full SHA
    bef8d33 View commit details
    Browse the repository at this point in the history