Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- What situations would be good to use context?
- 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.
- If you need to pass a prop down 1 or 2 levels, is context necessary?
- 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.
- Can you pass a component instance as a prop to avoid the need for context?
- Yes, this can help keep parents and childrens having seperate prop organization.
- Can you write your own components that accept render props?
- 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