Advertisement
Guest User

Untitled

a guest
Oct 15th, 2019
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. What situations would be good to use context?
  2. when trying to keep track of user themes, so youwouldn't have to pass theme as a prop to every single page/button/div etc.
  3.  
  4. If you need to pass a prop down 1 or 2 levels, is context necessary?
  5. If there is many components using the same context, it might be worth it. Otherwise you should just pass the prop to the single component.
  6.  
  7. Can you pass a component instance as a prop to avoid the need for context?
  8. Yes, this can help keep parents and childrens having seperate prop organization.
  9.  
  10. Can you write your own components that accept render props?
  11. yes, you write wrapper type components that accept the render prop which is a function that takes functions as argument in the form of a prop.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement