What is the difference between React’s flushSync() and the default batched state updates?

React Developer Hard

React Developer — Hard

What is the difference between React’s flushSync() and the default batched state updates?

Key points

  • flushSync() bypasses automatic batching for immediate updates
  • Useful when real-time DOM changes are needed
  • Ensures synchronous rendering within the callback

Ready to go further?

Related questions