Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Broken browser back button behavior #262

Open
kswin opened this issue Feb 21, 2019 · 6 comments
Open

Broken browser back button behavior #262

kswin opened this issue Feb 21, 2019 · 6 comments

Comments

@kswin
Copy link

kswin commented Feb 21, 2019

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

@kswin
Copy link
Author

kswin commented Feb 21, 2019

Similar behavior was described in #76, but this happens independently of time travel for me

@sugarshin
Copy link

+1

1 similar comment
@JiarongGu
Copy link

+1

@roryp2
Copy link

roryp2 commented May 7, 2019

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

@amareshb
Copy link

Is there a work around i can implement, until the PR is merged ?

@kswin
Copy link
Author

kswin commented 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants