Skip to content

Routing to a query returns to the default route #221

@hassanbazzi

Description

@hassanbazzi
Member

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.

Activity

developit

developit commented on Sep 8, 2017

@developit
Member

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.

developit

developit commented on Sep 8, 2017

@developit
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @developit@hassanbazzi

        Issue actions

          Routing to a query returns to the default route · Issue #221 · preactjs/preact-router