Advertisement
Guest User

Untitled

a guest
Mar 21st, 2019
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. What situations would be good to use context?
  2. It's used to share data that can be considered “global” for a tree of React components,
  3. such as the current authenticated user, theme, or preferred language.
  4. They can be used to avoid passing props through intermediate elements.
  5.  
  6. If you need to pass a prop down 1 or 2 levels, is context necessary?
  7. No it is not always neccessary.
  8.  
  9. Can you pass a component instance as a prop to avoid the need for context?
  10. Yes you can by using component composition.
  11.  
  12. Can you write your own components that accept render props?
  13. Yes.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement