loading...

re: My React stack for 2019 VIEW POST

FULL DISCUSSION
 

I'm not fond of React Router
I pretty much prefer using a simple router which plug on my redux store. That lets me have one single source of truth. When not using redux why not use React Router

For redux the boilerplate you talk about is lesser than you think, everyone which use redux want to reason with (reducer, selector, actions, actions creator), you don't need all this even with redux.

By the way I do think data fetching can be achieved by using Suspense and relatively well thought cache

 

I don't think that linking Redux with router is a good practice. I think it is much closer to presentational data and presentational data belongs to component state. That's why I would never put form state to Redux state.

 

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 ?

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.

Code of Conduct Report abuse