-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Lesson 05: activeStyle not working for me! #316
Comments
Can you be a bit more elaborate about activeClassName is not working? Are you getting an error or is the color not changing as expected? For me I did the following
and then when I try to use in the same file
it results in
which makes sense since according to the documentation here that isn't a prop that exists |
Actually I figured it out thanks to the ReactTraining docs on NavLinks BEFORE
AFTER
|
@addykim thank you so much, Addy. "The class to give the element when it is active". I paid no attention to 'active'. I am an English learner. I'm very happy you can understand my expression. And thank you very much. |
I had an issue where my CSS for If anyone sees an issue similar to this, check that. Make sure |
Based on this tutorial:
And when I navigate to: |
So it's been almost a year. Was it that hard to add |
@ddeamilivia
|
Thanks @renemeye ! |
@addykim its working for me as per your code but I have to manually refresh the page for getting the active link. I have got 3 links like: |
@usmanarif experiencing the same thing |
@usmanarif, @laspluviosillas I was having a similar issue but thanks to this issue I found out it was update blocking. Edit: I was using redux, and had to wrap my |
If you're using CSS Modules, try something like this CSS file:
JS file i.e.: PS: "styles" is the name I called my CSS file |
This is the code in my App.js. In the third li className works well. But activeStyle and activeClassName both don't work for Link. I have a css file about 'active'.
The text was updated successfully, but these errors were encountered: