DEV Community

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

Collapse
 
georgewl profile image
George WL • Edited

This may be easier with the new context API I feel.

Still a really cool example.

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.