Open matteo-bombelli opened 4 years ago
preact-router
will push the href
value as is to history
. I think you need to use hash based URLs if you really want to use them:
<Link href="/profile/">profile</Link>
<a href="/profile/example">profile example</a>
// vs
<Link href="#profile/">profile</Link>
<a href="#profile/example">profile example</a>
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.
preact-router
will push thehref
value as is tohistory
. I think you need to use hash based URLs if you really want to use them:<Link href="/profile/">profile</Link> <a href="/profile/example">profile example</a> // vs <Link href="#profile/">profile</Link> <a href="#profile/example">profile example</a>
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.
could a solution for this be appreciated?
it is possible to use
customHistory.createHref({pathname:props.href})
I am testing it right now
Thank you!
Yeah, I'd love to see support for that in preact-router
:+1:
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