flushSync can significantly hurt performance, and may unexpectedly force pending Suspense boundaries to show their fallback state.
Most of the time, flushSync can be avoided, so use flushSync as a last resort.
Could include those here as well. Despite the warnings I've nonetheless found flushSync to be useful in a few cases 🙂 like working with the View Transitions API
https://react.dev/reference/react-dom/flushSync
There are numerous disclaimers in the docs
Could include those here as well. Despite the warnings I've nonetheless found
flushSync
to be useful in a few cases 🙂 like working with the View Transitions API