question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Router doesn't follow history

See original GitHub issue

Describe the bug

Router back seems like doesn’t follow the history although there is the history: false option on the middle page (see fiddle) Scheme of page: About -> Edit Page (history: false) -> newPage

To Reproduce

Steps to reproduce the behavior (fiddle):

  1. Go to page about
  2. Click on button and go to edit page
  3. Click on button and go to new page
  4. Now try to go back you will see that it does not return to the first page

Expected behavior

It should skip the ignored page with the history: false option and go directly to the previous page (as per history). page -> editPage -> newPage page <- newPage

Actual Behavior

The page does not follow history. page -> editPage (history: false) -> newPage page <- editPage(the page doesn’t exist in history but is loaded) <- newPage

Additional context

In the fiddle you will also see the history debug with the routeChanged event

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:12 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
peitschiecommented, Sep 21, 2022

At a glance, it seems like something as simple as this in navigate.js

image

I don’t have an easy way to build and check though 🙈

1reaction
Simone4ecommented, Sep 23, 2022

@peitschie For now i resolve the problem use your tip reloadCurrent for change page from editPage -> newPage and for fix router.back() history i used a custom function from another bug report:

app.goBackReload = function (history) {
    app.views.main.router.back({
        url: history[history.length - 2],
        force: true,
        ignoreCache: true
    });
};

Seems like router.back with ignoreCache without specify the url doesn’t re-load the page instead use cache

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to view/access the history on my router when it doesn't ...
To track browser history in Internet Explorer 7, 8, 9, 10 and 11, click the "Tools" menu, "Internet Options", click the "Settings" button...
Read more >
React Router DOM's Router doesn't accept history correctly
I accidentally installed history as a dev-dependency, which is causing the types to be incompatible. To resolve this, I remove history and ...
Read more >
How to Check Router History - Lifewire
Can You Check Wi-Fi History? · Log into your router via your web browser. · Look for something called Outgoing Log Table, System...
Read more >
Are there anyway to track people's browser history through my ...
Sonicwall has an embedded firewall application that tracks all of your users internet traffic and displays them in both a list or chart ......
Read more >
Router with custom history doesn't render route, only URL is ...
You're using the wrong version of history . 5.x/4.x of Router are only compatible with history 4.x.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found