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

330
Vistas
how to delete the current screen from history stack in react-router-dom v6?

In react-router-dom v6 we can call navigate(-1) in order to go one screen back. but what I want to achieve is a kind of navigate(-1) which removes the current URL from the stack as well. So the purpose is to have a disabled forward button in the browser after the user has gone one screen back. like:

disabled back button

Note that I also tried replacing the current URL with the previous one but it's not a good solution because if the user clicks on the back button they will remain on the same screen which is weird.

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

You are going to modify the history, and As far as I know, there's no way to delete a history entry (or state).

One way I've been looking into is to handle the history yourself in JavaScript with onpopState listener

https://developer.mozilla.org/en-US/docs/Web/API/History_API#examples

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