Open Aurailus opened 3 years ago
Possibly related to #365 ?
Any updates on that? I have the very same issue.
Any updates? Same problem here.
I see the same behaviour. Link from match
does not have activeClassName
applied when on href
route.
As per this comment: https://github.com/preactjs/preact-router/issues/333#issuecomment-543839970, this is fixed for me if I use import { Link } from 'preact-router/match';
rather than import { Link } from 'preact-router';
(preact-router v3.2.1)
The active class with Link
from match
doesn't work for SSR pages.
<Link>
from preact-router/src/index.js
should just reexport from preact-router/match/src/index.js
There is indeed bug with matching <Link>
and activeClassName
when className
is present
import { Link } from 'preact-router/match';
<Link activeClassName="is-active" class="c-header-link" href="/foo">Foo</Link> // works
<Link activeClassName="is-active" className="c-header-link" href="/foo">Foo</Link> // does not work
Tested with preact@10.15.1 and preact-router@4.1.1
Hi, I'm trying to use ActiveClassName to style my links, but the property is not being processed, and is instead being passed down to the native DOM. Here's my code:
And the resultant HTML:
I as on /admin/home when I copied the above HTML. Please let me know if you need any more information.