purescript-react / purescript-react-basic-dom

https://pursuit.purescript.org/packages/purescript-react-basic-dom
Apache License 2.0
11 stars 19 forks source link

Add flushSync #53

Closed pete-murphy closed 1 year ago

pete-murphy commented 1 year ago

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