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.

Broken browser back button behavior

See original GitHub issue

Store updates from history.listen break browser back behavior, causing user to ping-pong between 2 routes.

Steps to reproduce:

  1. User visits /home ->/hello -> /counter
  2. On /counter, clicks browser back and lands on /hello
  3. On /hello clicks browser back

Expected behavior: lands on /home Actual behavior: lands on /counter

GIF Illustration: ping pong

Branch that reproduces issue is available here: https://github.com/kswin/connected-react-router/tree/poc/broken-browser-back

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:10
  • Comments:6

github_iconTop GitHub Comments

3reactions
roryp2commented, May 7, 2019

Is this going to be fixed? still an issue, even without time travel

0reactions
kswincommented, Jul 24, 2019

Well, I did fork this project and made time travel optional. That was the bit of code that caused the bug -> https://github.com/kswin/connected-react-router

// in package.json
 "connected-react-router": "github:kswin/connected-react-router"

// from your routes file
<ConnectedRouter history={reactHistory} hasTimeTravel={false}>

For the exact code change to the source see src/ConnectedRouter.js in PR https://github.com/kswin/connected-react-router/pull/3/files

It’s a long PR, but that’s because most files are just the distribution

Read more comments on GitHub >

github_iconTop Results From Across the Web

FIX: Back Button Not Working in Web Browser?
Usually, the Back button in a browser fails to function correctly due to reasons such as redirecting links and conflicting browser extensions.
Read more >
[WEB] browser back button handling is broken #10263 - GitHub
Current behavior. Whenever the initial screen is reached, the rest of the history gets wiped out. Eg. when you navigate to:
Read more >
Browser Back Button not working on Windows PC
Browser Back Button not working on Windows PC · 1] Clear the browser cache · 2] Skip the redirecting addresses · 3] Disable...
Read more >
Broken product links after pressing the browser back button
In the shop of @flexes when he clicked on a product on the homepage, then hit the back button, the browser redirected him...
Read more >
Troubleshooting Browser Back Button Not Working
Fix: The Back Button Doesn't Work · 1. Disable your extensions/ add-ons · 2. Clear your cache · 3. Reset or reinstall your...
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