DEV Community

loading...

Discussion on: My React stack for 2019

Collapse
chibiblasphem profile image
Debove Christopher

What lies in redux store is widely use data, it could be some application state (login state, sidebar visibility state, current route - routing)

What lies in component state is the state of this said component.

If i'm extrapolating your point, if I have flag which tells me if the sidebar is open (pure presentational data) I have to store it in the state of the top level component and pass the value or/and the update function for this value for all the components that need it ?

Thread Thread
pajasevi profile image
Pavel Ševčík Author

Basically yes. It's a separation of concerns - presentational data are not mixed with app data. Altough it could also be achieved using separate redux store.
But this is just my opinion, not a definitive answer to app state management. Clearly there is a lot of ways and what's important is that everything stays clear and easy to maintain/develop/debug.