React router redux
2 container routes both connected and subscribing only to the router redux reducer. hostname/route1/ and hostname/route2
Are these behaviours intended?
I would have expected the browsers back/forward button to only trigger the container we are going to not the one we are leaving.
An example of what you're seeing is really necessary here. But there are known issues with double-rendering right now. Hence the alpha status.
Hi, thanks for quick reply. Just wanted to make sure this was a bug and not intended.
I made up a sandbox of what i see in my project here https://codesandbox.io/s/8yv7p018rl
Then follow this:
@timdorr any specific reason for deleting the comments? Looks like you want to hide your failure from the world!
This type of nature will encourage the people to fork the repo. and maintain their own copy instead of contributing to original and that will the defeat the purpose of opensource!
They weren't helpful or constructive comments. I'm not hiding anything other than offtopic discussion.
Agreed.
But, even if those comments are constructive they will reveal the desire to fix the issue and may encourage someone to contribute a fix!
And now instead of having debates on that, can we discuss the original issue? :)
If you can give me the glimpse of corner that can cause this rendering, I can look and can send a PR.
UPDATE: The fix for my team was to simply to drop react-router-redux. We looked at our usage of it and deemed it not necessary.
I've come across this issue as well.
Using: [email protected] [email protected]
Basically in the exact same situation as @wayweary.
To maybe add more background into the mix, I have noticed that the undesired rerender occurs before the LOCATION_CHANGE action is emitted by the react-router-redux middleware - due to a change in the router.location.pathname state which the connected component observes.
What I have observed is this:
LOCATION_CHANGE is dispatched with the new pathnameI am having a similar issue. The problem is compounded by the fact that the previous component rerenders with the new (!) location.
I would expect a component added to a route to never render on the wrong location since it generates issues with loading data, especially since we are using query parameters in the url for state management.
Closing this out since react-router-redux is deprecated. Use connected-react-router instead!
so sad to see this closed since connected-react-router only works with v4