React Context

A React feature that lets a parent component make a value available to every component below it without passing it as props.

In more detail

createContext makes a context object, a Provider element supplies the value, and useContext reads it. Compound components use a private context to share state, such as which tab is active. Context still works inside portals because it follows the React tree, not the DOM tree.

Related terms

Taught in

References