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

324
Views
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 answers
Answer question

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 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!