-
-
Notifications
You must be signed in to change notification settings - Fork 10.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Active routes not changing when used with react-redux
#3536
Comments
See previous discussions around link and pure containers. |
Note that this is fixed in react-router@next and 3.0. |
@timdorr Any chance you can point me to the changes that made it work? I'd like to see just for educational purposes. |
FYI. I can reproduce this again on |
Please read earlier comments on the issue. |
@taion I read it. So, this is expected behavior until you pass {pure:false}? |
That's how React context works. For reasons of avoiding breakage per semver, we cannot ship the workaround for this in the 2.x line. |
I'm currently also facing this issue and used {pure:false} as a workaround. Best, |
Thanks @mertkahyaoglu, that solution works for me with |
[this issue](remix-run/react-router#3536) is fixed with react-router v3.0.0
There is some problem with the combination of react-router and react-bootstrap that causes a single nav link, e.g. users or subs, to be stuck activated regardless of the actual current url. I found a fix here remix-run/react-router#3536 and an explanation here https://github.com/ReactTraining/react-router/blob/master/packages/react-router/docs/guides/blocked-updates.md
Only initial route gets active class but when I change the route, it is still showing the first route as active.
This happens when the component containing
Link
s is wrapped withconnect
like this;export default connect(mapStateToProps, mapDispatchToProps)(Sidebar);
But when I export it as a plain component like this;
export default Sidebar;
Active links are changing correctly. Is this a bug or am I missing something?
Versions;
react-router: 2.4.0,
react-router-redux: ^4.0.4
The text was updated successfully, but these errors were encountered: