preactjs / preact-router

:earth_americas: URL router for Preact.
http://npm.im/preact-router
MIT License
1.01k stars 156 forks source link

Add support for `activeClassName` and `activeClass` #421

Closed IdkGoodName closed 1 year ago

IdkGoodName commented 2 years ago

This fixes "activeClassName" not being added when <Link>'s href property and current URL match, as well as adds "activeClass" property.

I am not sure whether "activeClass" should be documented in README or anywhere else.

rschristian commented 2 years ago

I believe this is intentional, use import { Link } from 'preact-router/match'; instead when you want this behavior.

Implemented here

Docs showing preact-router/match here