Redocly / Redocly/redoc

Routing unavailable with HashRouter

Open
#2,403 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
25.9k
Forks
2.4k
Avg merge
13h 10m
Merged PRs (30d)
4

Description

There are unfortunately situations in which we have to use HashRouter, and I would ideally like the ability to be able to link to certain parts of the spec. So while @kaitmore's solution solves the url overwrite problem, the ability to route to a particular part of the spec from somewhere else on your site is unavailable as a result.

I don't think use BrowserRouter or disabling location updates altogether is a viable solution here. I think @TranquilMarmot's answer using URL parameters is a great idea. Thanks for the help!

Originally posted by @kbourque in https://github.com/Redocly/redoc/issues/655#issuecomment-1710392140

Contributor guide

Open the contributing guide

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 at the HashRouter routing entry point and trace how location updates currently affect links to parts of the spec. Investigate the URL-parameter approach mentioned in the issue, with the goal of allowing direct links to a particular spec section without the URL being overwritten.

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
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.