React re-renders: Context Trap 💣
You’ve mastered memo, useCallback, and useMemo. Your components are optimized. Life is good. Then you add Context… and everything re-renders again. Welcome to the Context trap. How Context Works Every component using useContext re-renders when the context value changes. No exceptions. React.memo won’t save you. Your optimizations? Worthless. // ❌ This memo does NOTHING const UserProfile = memo(function UserProfile() { const user = useContext(UserContext); return <div>{user.name}</div>; }); When state in a context provider updates, React forces all context consumers to re-render, completely bypassing any memoization. ...