React
Rendering behavior, reconciliation, hooks, and state management — what actually triggers a re-render and how to keep component state predictable.
State as a Snapshot in React
BeginnerEvery render gets its own fixed copy of state. The setter schedules the next render rather than changing the value your handler is already holding, which is why three increments in one click add up to one.
Effect Cleanup in React
IntermediateThe function that an effect returns runs before every re-run and once more on unmount. Skipping it is how timers stack up, listeners pile on, and a slow response overwrites a newer one.