Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

188
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda