a guest Mar 21st, 2019 52 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
- What situations would be good to use context?
- It's used to share data that can be considered “global” for a tree of React components,
- such as the current authenticated user, theme, or preferred language.
- They can be used to avoid passing props through intermediate elements.
- If you need to pass a prop down 1 or 2 levels, is context necessary?
- No it is not always neccessary.
- Can you pass a component instance as a prop to avoid the need for context?
- Yes you can by using component composition.
- Can you write your own components that accept render props?
RAW Paste Data