DEV Community

Discussion on: Passing Data from Child to Parent with React Hooks

Collapse
 
pnkfluffy profile image
Jackson Felty

Yes! Context API is certainly a better way to do this if your passing data through multiple layers of the component tree. I feel like simply using a function is a better, more readable method when one variable needs to be passed up a single component.