ReactDOM.flushSync reference
19 September 2022 (Updated 19 September 2022)
In React 18, all state updates are batched by default. Usually, this is what you want, but in the rare case that you need to read from the DOM immediately after a state change, you can use ReactDOM.flushSync()
to opt out of batching.
Sources
Tagged:
React
Thanks for your comment . Once it's approved, it will appear here.
Leave a comment