Skip to main content
Journey Uncommon Logo
JourneyUncommon
hardReactflushSyncSingle-choice MCQ

flushSync forces a synchronous render-and-commit before it returns. A senior calls flushSync inside the middle of a React event handler that already has other queued state updates. What does flushSync do to those PREVIOUSLY queued (still-pending) updates?

function handle() { setA(1); // queued in the handler's batch flushSync(() => { setB(2); // forced sync }); setC(3); // queued after }