Publish to my blog (weekly)
React as a UI Runtime — Overreacted - re - render Child // - re - render Child - re - render Parent - re - render Child The setState calls in components wouldn’t immediately cause a re-render. Instead, React would execute all event handlers first, and then trigger a single re-render batching all of those updates together. If we start with count set to 0 , these would just be three setCount(1) calls. To fix this, setState provides an overload that accepts an “updater” function: c => c + 1 ...