APIs
Context provider
Supply a value to descendants. React 19 supports the context tag; .Provider also supports React 18.
Formal Syntax & Structure
react syntaxreact
<Context value={value}>{children}</Context>Working Example
Example Snippetreact
<DensityContext.Provider value="compact"><Shelf /></DensityContext.Provider>