React Core & Hooks (407 Qs)•Part 9: React Hooks Deep Dive (262 - 316)
What is context?
junior LevelCode ExampleHooks
Context provides a way to pass data through the component tree without having to pass props down manually at every level.
vbnet
For example, authenticated users, locale preferences, UI themes need to be accessed in the application by many components.
javascript
const { Provider, Consumer } = React.createContext(defaultValue);