Skip to content
DevDepth

Tag: react-hooks

3 items under this tag.

Tag Filter

All Content
6 min readreact-internalsReactInternals

useEffect vs useLayoutEffect: The Real Difference in React’s Commit Phase

Understand how React Fiber stores both hooks in the same effect list, why HookLayout and HookPassive tags matter, and when each runs during the commit phase.

11 min readreact-internalsReactInternals

useState vs useReducer in React: How They're Really Related

Understand the real difference between useState and useReducer in React, why useState is basically a special case of useReducer, and when each Hook is the better fit.

8 min readreact-internalsReactInternals

Why Hooks Can’t Be Used in Conditions, Loops, or Nested Functions

React Hooks rely on call order, not variable names. Learn how Fiber stores hooks in a linked list and why changing the call order breaks state alignment.