0
What’s the difference between “lifting state up” and using Context API?
subina kallyani
easy
2completed
72
Answer
- Lifting state up: move state to the nearest common parent and pass props down. Best for small scope.
- Context: avoid “prop drilling” when state needs to be accessed across many deeply nested components. But Context re-renders all consumers on change, so use sparingly for global state (theme, auth, locale).
Click to Reveal Answer
Tap anywhere to see the solution
Revealed
Comments0