mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
e7e0a90bd8
This reverts commit 0e3c7e1d62efb6238b69e5295d45b9bd2dcf9181. 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.