Skip to content

Conversation

@pete-murphy
Copy link
Member

@pete-murphypete-murphy commented May 18, 2023

https://react.dev/reference/react-dom/flushSync

There are numerous disclaimers in the docs

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

@pete-murphypete-murphy marked this pull request as ready for review May 20, 2023 16:28
@i-am-the-slimei-am-the-slime merged commit b93b156 into purescript-react:mainJul 11, 2023
@pete-murphypete-murphy deleted the pm/add-flush-sync branch July 15, 2023 16:37
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@pete-murphy@i-am-the-slime