Context in React
summary
Claims that Context is for sharing state only inside a component tree not as global app state and that it removes prop drilling. Uses React createContext/Provider, class property contextType (React 16.6) and the new useContext hook, and cites 16.3/16.6/hook timing. Demonstrates a fleet dashboard multi-step form sharing parent state and two updater functions, notes a rerender gotcha when passing fresh objects and fixes it by storing methods on the top-level state, and the refactor is described as working.
AI-written summary · about
chapters (3)
related talks
22mPowering Code Reuse with Context and Render Props
12mContext with React 19
27mLet's Build React Context From Scratch in JS
17mLearn how to use the React Context API
20mLet's Build React Context From Scratch in JS
35mHandling Large-Scale State Management with Context and Hooks
31mAll about Context API
55mThe State of React’s State in 2019
