Skip to content

Navigation link not highligthed when active URLย #34

@maximeborges

Description

@maximeborges

I'm really new to (p)react, and one of the first thing I noticed is that the Link to the active page is not highligthed as it should be seeing the code. I tried to investigate and I found out that the css classes generated for the client is suffixed with the hash of the current file to isolate class. The problem is that not only the 'root' class imported is suffixed, but the '.active' from '.header nav a.active' is also suffixed and that the activeClassName only append 'active' and not 'active__xxxxx' to the html tag.
CSS wanted to be applied:

.header nav a.active {
	background: rgba(255,255,255,0.4);
}

CSS generated for the client:

.header__3QGkI nav a.active__3gItZ {
	background: rgba(255,255,255,0.4);
}

Sample of jsx for the Link:
<Link activeClassName="active" href="/">Home</Link>
Generated HTML on an active page:
<a href="/" class="active">Home</a>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions