You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Links of the form <Link href="path" /> rather than <Link href="/path" /> that are missing the leading slash are routed but trigger a page reload. It's an easy mistake to make since the routing occurs as expected and a difficult problem to diagnose.
Possible solutions:
Don't allow routes missing the leading slash
Don't trigger the reload
Mention it in the readme
Example:
importRouter,{Link}from"preact-router";import{VNode,render}from"preact";constHome=(): VNode=>(<><Linkhref="/about">/about</Link><br/><Linkhref="about">about (matches but reloads)</Link></>);constAbout=(): VNode=><Linkhref="/home">/home</Link>render(<Router><Homedefaultpath="/"/><Aboutpath="/about"/></Router>,document.getElementById("root")asHTMLDivElement);
The text was updated successfully, but these errors were encountered:
Links of the form
<Link href="path" />
rather than<Link href="/path" />
that are missing the leading slash are routed but trigger a page reload. It's an easy mistake to make since the routing occurs as expected and a difficult problem to diagnose.Possible solutions:
Example:
The text was updated successfully, but these errors were encountered: