Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

338
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda