-
Notifications
You must be signed in to change notification settings - Fork 7
Context API
ALL edited this page Jan 11, 2020
·
1 revision
- Context is designed to share data that can be considered “global” for a tree of React components
- Ex. Current authenticated user, theme, or preferred language
- Using context, we can avoid passing props through intermediate elements
- Context is primarily used when some data needs to be accessible by many components at different nesting levels
- Apply it sparingly because it makes component reuse more difficult