context provider

The component that supplies a context value to everything inside it.

In more detail

In React 19 you render the context itself as the provider, as in <ThemeContext value={theme}>, instead of the older <ThemeContext.Provider>. Providers can be nested, and a nearer provider overrides a farther one for its subtree. Passing a new object literal as value each render re-renders all consumers.

Examples

A compound Tabs root renders <Ctx.Provider value="tab1"> around its children.
<ThemeContext value={{ mode }}><Display /></ThemeContext>

Related terms

Taught in

References