React DOM integration

flushSync

Exceptional synchronous integration when an immediate DOM read is required.

Formal Syntax & Structure

react syntaxreact
flushSync(() => setRows(old => [...old, row]))

Working Example

Example Snippetreact
flushSync(() => setRows(old => [...old, row]))
React Reference