Hooks
useContext
Read and subscribe to the value supplied by the nearest matching ancestor provider.
Formal Syntax & Structure
react syntaxreact
const value = useContext(Context);Working Example
Example Snippetreact
const density = useContext(DensityContext);