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

178
Views
ReactJS - Going back in nested routes with Reacter Router Dom V6

My initial page is

http://localhost:3000/home

With a navigation bar I go to a list of products in:

http://localhost:3000/products/all/

When I click a product in the list I go to:

 http://localhost:3000/products/banana/

Now if I click Back on the browser or if I make a button with the new useNavigate and try to do navigate(-1) I go to /home in both examples.

How can I make it so I go to /products/all/ with useNavigate and hopefully I can do change the browser interaction too?

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

The problem in my case was that I was using replace:true when I was navigating with useNavigate from the list of the products to a particular product. Sorry if it seeemed that I didn't give enough information but this solved my issue.

https://reactrouter.com/docs/en/v6/api#usenavigate

about 4 years ago · Juan Pablo Isaza Report
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!