DEV Community

Discussion on: React.js: The one way and the opposite way data flow

Collapse
 
anxiny profile image
Anxiny

Yes, if you only need to pass state change one or two levels or with very few children, pass setState as prop will be fine.

But, if you need to manage complex state, use Context API with useReduer hook in the container component will be easier to maintain and scale. Or use other state management lib like redux

Thread Thread
 
ridhamz profile image
Ridha Mezrigui

i agree