Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

128
Views
Adding a subpath to the React website for the Hash Router

We are using a react website with hash-router and the local URL looks something like this:

http://0.0.0.0:4321/#/

I want to always add a subpath for the URL and it should work something like this:

http://0.0.0.0:4321/somepath/#/
http://0.0.0.0:4321/somepath/#/somepage

I always want to have the URL in above format. While I have used base path in Hashrouter like this:

<HashRouter basename={'/somepath'}>

I am getting a URL in this format:

http://0.0.0.0:4321/#/somepath/
http://0.0.0.0:4321/#/somepath/somepage

Any changes that I have to do else where in the project to always have this path? I have tried to replicate this in a Sandbox: https://codesandbox.io/s/react-typescript-forked-jk8e9?file=/src/App.tsx, but it seems to not work properly.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!