react-router-redux Redirects no longer trigger an action to the reducer
See original GitHub issueVersion
react-router-redux@5.0.0-alpha.7 & react-router-redux@5.0.0-alpha.8
Summary
Redirects in a route nolonger trigger an action to the reducer.
Steps to reproduce
My routes setup.
const Routes = ({store}) => (
<CoreLayout>
<Switch>
<Route exact={true} path='/' render={Routes.homeRedirect} />
<Route path='/photos/:folder*' component={PhotoView} />
</Switch>
</CoreLayout>
)
Routes.homeRedirect = () => (
<Redirect to='/photos' />
)
Expected Behavior
In version alpha.6 both the initial page load and the redirect are sent to the reducer.
{
type: '@@router/LOCATION_CHANGE',
payload: {
pathname: '/',
search: '',
hash: ''
}
}
{
type: '@@router/LOCATION_CHANGE',
payload: {
pathname: '/photos',
search: '',
hash: '',
key: 'mswocw'
}
}
Actual Behavior
With version alpha.7 and 8 the only initial page load is sent to the reducer
{
type: '@@router/LOCATION_CHANGE',
payload: {
pathname: '/',
search: '',
hash: ''
}
}
Issue Analytics
- State:
- Created 6 years ago
- Reactions:16
- Comments:21 (3 by maintainers)
Top Results From Across the Web
react-router-redux Redirects no longer trigger an action to the ...
I have the similiar problem. In my case, action @@router/LOCATION_CHANGE triggered twice with different pathname in wrong order: first, with ...
Read more >React router redirect after action redux - Stack Overflow
I want to redirect to page with registrationStep2. How can I do this? p.s. In history browser '/registrationStep2' has not been visited. This ......
Read more >How to Transition to Another Route on Successful Async ...
In this guide, we will use a Redux action to redirect the user using the <Redirect ... Let's begin with action creators and...
Read more >React Router with Redux: Understanding navigation state
Use React Router to declaratively navigate within your React and Redux applications and maintain state across your app's navigation ...
Read more >Redirect On Action Strategy using redux | by Ofir G - Medium
ErrorRedirectReducer — A relatively small reducer, that activate on two actions, RedirectAction , RedirectDoneAction , and write their payload ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Experiencing this issue as well.
Connected Router beings listening to history in componentDidMount and react-router Redirect performs the history push in componentDidMount as well. Because componentDidMount is called on children before the parent, there is a moment where a Redirect pushes a new history but the Connected Router is not yet listening to history.
Alpha 9 is up. We’ll get this right at some point…