-
Notifications
You must be signed in to change notification settings - Fork 592
Open
Labels
Description
It doesn't seem like it is possible to access the match object in the reducer. Should there be a way to connect a specific Route so that its state is saved to the reducer as well? Something like
import { ConnectedRouter, ConnectedRoute } from 'connected-react-router'
...
<ConnectedRouter history={history}>
<ConnectedRoute path='/example/:willshow' />
<Route path='/example/:wontshow' />
</ConnectedRouter>
that would generate the state
{
history: {
location: {
path: '/example/somevalue'
}
},
match: {
params: {
willshow: 'somevalue'
},
// ... React-Router match object (from https://reacttraining.com/react-router/#match)
}
}
This would basically make the reducer state be the same as the Router object received from the withRouter
connector.
trungdq88, python273, dmitrienkop, AdrienLemaire, thenewguy and 28 more