acdlite / redux-router

Redux bindings for React Router – keep your router state inside your Redux store
MIT License
2.3k stars 200 forks source link

Router state duplication #59

Open smashercosmo opened 9 years ago

smashercosmo commented 9 years ago

It seems to me that there is some overhead with keeping router state. When using redux-react-router we have router state in our app state and also in the component's props. So we have

this.props.router.location this.props.router.component this.props.router.params this.props.router.routes

this.props.params this.props.location this.props.history this.props.routes this.props.route this.props.routeParams

Is there any way to reduce number of props kept?

stefvhuynh commented 9 years ago

+1

tedpennings commented 9 years ago

:+1:

tedpennings commented 9 years ago

Slightly related, we end up having a huge amount of duplicated state between the redux-router part of our Redux state and the rest of our Redux state. We're sort of in this position because we are using combineReducers for modularity, but that means any routable-bits of our overall application state have to be duplicated between the redux-router state and the rest of our Redux application state. It would be nice to see a more cohesive approach to this.

skuridin commented 9 years ago

:+1:

jineshshah36 commented 8 years ago

+1

wi-ski commented 7 years ago

Just out of curiosity - would something like simply removing:

this.props.params
this.props.location
this.props.history
this.props.routes
this.props.route
this.props.routeParams

Be a solution? Ultimately tucking all those props into the router itself? Changes like this are definitely braking imo - that being said - any thoughts?