Concept
Context
Passing data deep into a component tree without threading props through every level.
Learn firstReact hooks
Context
What should you learn before Context?
- FunctionsReusable blocks of code; in JavaScript they are values that can be passed around and returned.
- PropsInputs passed from a parent component to a child.
- Variables and scopeWhere a variable can be read: global, function and block scope, and how let, const and var differ.
- ClosuresA function that keeps access to the variables of the scope it was created in, after that scope has finished.
- StateData that changes over time and makes the UI re-render, and where to keep it.
- React hooksFunctions such as useState and useEffect that add state and lifecycle to function components.
Practise Context
- React Interview Questions for Freshers1 question on Context
- Intermediate React Interview Questions1 question on Context