Skip to content
This repository was archived by the owner on Jul 19, 2019. It is now read-only.

Lesson 12 - Using withRouter instead of context #285

Closed
ZackWard opened this issue Feb 7, 2017 · 1 comment
Closed

Lesson 12 - Using withRouter instead of context #285

ZackWard opened this issue Feb 7, 2017 · 1 comment

Comments

@ZackWard
Copy link

ZackWard commented Feb 7, 2017

My short story:

I'm learning react-router, so I follow the tutorial and learn about <Links>. They work great. Now I want to make them work with Bootstrap, but I need to add the active class to the <li> instead of the <a>. I try to implement my own version of <Link> that adds the class in the correct place. It works on a page refresh but not while navigating, because my custom <BootstrapLink> gets the router from the context but doesn't use the ContextSubscriber mixin. I Google. I find withRouter. I think maybe it would be nice for this to be in the tutorial. 😄

Hopefully this will save learners some time and googling.

@ZackWard
Copy link
Author

ZackWard commented Sep 1, 2017

Closing stale issues

@ZackWard ZackWard closed this as completed Sep 1, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant