preact-router
preact-router copied to clipboard
Routing to a query returns to the default route
Demo: http://jsfiddle.net/qc73v9va/49/
If you click Profile, then click the Click me for query
link, you'll be redirected to the homepage.
My use case is that I want to be on any route /x/y
and then easily attach a query param to it / update it.
Maybe I'm doing this wrong, but I expect route
to do that. I can obviously grab the location, but just wondering if this is expected behavior.
Definitely worth adding yup. Technically this is a dupe of #129 - if we supported relative paths in route()
and links, route('?foo')
would be relative to the current route instead of being treated as /?foo
.
There's a PR open for the behavior if you're up for reviewing! #138 and my alternative that abuses the DOM to do it, #177.