Isolating React component updates with useSyncExternalStore

The hidden cost of state updates As described in the React docs , component renders happen in a three-stage process: trigger, render and commit. Stage 1 : Trigger occurs from either the initial render or from a state update. Stage 2 : Render calls your component to see what has changed. Stage 3 : Commit applies the changes to the DOM. Most developers focus on stage 3 when discussing performance…