Closed darrinm closed 3 months ago
This pull request is automatically built and testable in CodeSandbox.
To see build info of the built libraries, click here or the icon next to each commit SHA.
Latest deployment of this branch, based on commit 71c4ee49a578cd7b7ca745dd973fc28654166d4a:
Sandbox | Source |
---|---|
example | Configuration |
Add a
flushSync
R3F API to do the same thing as thereact-dom
flushSync
API. Which is to synchronously and immediately render by boosting the priority of changes that occur within the passed callback function.See https://react.dev/reference/react-dom/flushSync.
Because of its potential performance impact
flushSync
is a "last resort" option when one must synchronize R3F rendering with something else, e.g. DOM changes.