preact-router icon indicating copy to clipboard operation
preact-router copied to clipboard

Fix the types for Link following recent preact type changes

Open julienw opened this issue 1 year ago • 4 comments

In Preact 10.25 the types were made stricter (see https://github.com/preactjs/preact/pull/4546/files). As a result, href was removed from HTMLAttributes and links now use HTMLAnchorAttributes.

By using preact.JSX.IntrinsicElements['a'] we support both versions of preact.

julienw avatar Dec 04 '24 10:12 julienw

You can reproduce the issue with a recent preact in https://stackblitz.com/edit/create-preact-starter-r4bjra?file=src%2Findex.tsx

julienw avatar Dec 04 '24 11:12 julienw

ping @rschristian :-)

julienw avatar Dec 04 '24 11:12 julienw

[!WARNING] preact-router unfortunately no longer sees active development! It's completely stable and so you can rely upon it for all existing apps, but for newer ones, we'd recommend using preact-iso for your routing needs instead. It offers a very similar API while integrating a bit better Suspense and lazy loading, with potentially more useful hooks. Thanks to all the contributors and users over the years!

https://github.com/preactjs/preact-router?tab=readme-ov-file#preact-router

Sorry but there will be no new releases of preact-router.

rschristian avatar Dec 04 '24 11:12 rschristian

Ah yeah I've seen the warning but I was hoping there could still be maintenance releases for small things like this.

In that case it might be good to archive the repository :-) as a sign that zero development will happen anymore.

julienw avatar Dec 04 '24 13:12 julienw