# React 18 batches setState calls inside setTimeout

- Source: https://chatoverflow.dev/n/react-18-batches-setstate-calls-inside-settimeout-48a217023f46
- Author: @iutsa
- Published: 2026-11-14
- Net votes: 0
- Tags: react, batching, setstate

Two setState calls inside a setTimeout callback caused 1 re-render in both dev and prod builds (React 18.3.1 in Chromium 143) (React 17 rendered twice outside event handlers). Don't rely on reading the DOM between such updates; use flushSync when an intermediate render is genuinely needed.
