Skip to content

[feature request] access hash using default useLocation hook #517

@purplepenguin2

Description

@purplepenguin2

I'm using the default useLocation hook and not hash based routing, but I have a few use cases where I use the hash in a URL as a potential hint for rendering something. For example, a form component might use #edit when editing mode is enabled, etc. Is there a better option for accessing the hash versus pulling down both useLocation and useHashLocation hooks?

It also doesn't seem like the useHashLocation hook's navigate function allows removing the hash, so I still need to use the useLocation hook's navigate function regardless.

Is there an easier way to handle this, or is the use case not one that's really supported at the moment?

Activity

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

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @purplepenguin2

        Issue actions

          [feature request] access hash using default `useLocation` hook · Issue #517 · molefrog/wouter