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
Issue description:
When using Link (or a tag) with hash history when the user open a link in the new page, the resulting url does not contain the hashbang.
How to replicate
using preact cli with default template and then install history module
npx react-cli create default testHashNavigation
Code
/src/components/app.js
import{h,Component}from'preact';import{Router}from'preact-router';importHeaderfrom'./header';// Code-splitting is automated for routesimportHomefrom'../routes/home';importProfilefrom'../routes/profile';import{createHashHistory}from'history';exportdefaultclassAppextendsComponent{/** Gets fired when the route changes. * @param {Object} event "change" event from [preact-router](http://git.io/preact-router) * @param {string} event.url The newly routed URL */handleRoute=e=>{this.currentUrl=e.url;};render(){return(<divid="app"><Routerhistory={createHashHistory()}><Homepath="/"/><Profilepath="/profile/"user="me"/><Profilepath="/profile/:user"/></Router></div>);}}
/src/routes/home/index.js
import{h}from'preact';importstylefrom'./style';import{Link}from"preact-router";constHome=()=>(<divclass={style.home}><h1>Home</h1><p>This is the Home component.</p><ul><li><Linkhref="/profile/">profile</Link></li><li><ahref="/profile/example">profile example</a></li></ul></div>);exportdefaultHome;
It'd be nice if the router could be made aware of what kind of history it's using so that the URL can be formatted automatically, but I'm not aware of any way to detect that.
It'd be nice if the router could be made aware of what kind of history it's using so that the URL can be formatted automatically, but I'm not aware of any way to detect that.
Issue description:
When using Link (or a tag) with hash history when the user open a link in the new page, the resulting url does not contain the hashbang.
How to replicate
using preact cli with default template and then install history module
npx react-cli create default testHashNavigation
Code
/src/components/app.js
/src/routes/home/index.js
/package.json
The text was updated successfully, but these errors were encountered: