11 min readreact-internalsReactInternals
Is setState Synchronous or Asynchronous in React? React 18 vs Earlier Versions
Learn when setState appears synchronous or asynchronous in React, why the answer changes across calling contexts, and how React 18 automatic batching changes the behavior.