molefrog / molefrog/wouter

[feature request] access hash using default `useLocation` hook

Open
#517 1 comment 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
7.9k
Forks
190
Avg merge
12h 50m
Merged PRs (30d)
3

Description

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?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the existing useLocation and useHashLocation hook APIs, focusing on how each exposes the URL hash and handles navigation. Determine whether a supported API can cover reading and removing the hash without requiring both hooks; done should be a clear, documented behavior that addresses both use cases.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
frontend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
32/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.