Posts tagged with #state

Context for Shared State in React

Learn how React context providers pass typed values to consumers, when context helps avoid prop drilling, and when local state or a store fits better.

React State with useState and TypeScript

Learn how useState snapshots work, how TypeScript infers state types, and how to update objects and arrays immutably in React components.

Sharing State and Lifting State Up in React

Learn when sibling React components need shared state, how to lift it to their nearest common owner, and why local state often beats global state.