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

push not working #447

Open
harshitshah27 opened this issue Sep 7, 2020 · 6 comments
Open

push not working #447

harshitshah27 opened this issue Sep 7, 2020 · 6 comments

Comments

@harshitshah27
Copy link

Push is changing the URL but not redirecting actually to the url

@Revinand
Copy link

I've got the same problem when installed version 5.0 of the history package. Downgrading to the version 4.10.1 helped me.

remix-run/history#803
remix-run/history#804

@lpakula
Copy link

lpakula commented Nov 2, 2020

I'm also having the same issue with history@4.10.1

URL is changing but it's not really redirecting (eg. staying on Login page)

"history": "4.10.1",
"connected-react-router": "6.8.0",
"react-router-dom": "^5.2.0",
"react-redux": "^7.2.1",
"redux": "^4.0.5",

I'm running development server

yarn --version
1.13.0

if i use dispatch(go("/")) instead of dispatch(push("/")) i get redirected correctly, however, it's obviously refresing the page

Any ideas? what other dependency might cause the conflict ?

@lpakula
Copy link

lpakula commented Nov 3, 2020

Ok, i resolved my problem as described in #417

@tibic
Copy link

tibic commented Dec 8, 2020

@lpakula dispatch(go("/")),我这里显示go的类型是number,不是字符串

@tibic
Copy link

tibic commented Dec 8, 2020

push后再dispatch(go(0))

@low-ghost
Copy link

The exact problem is in fact described in #417 and solved there. Pasting my comment there for visibility here, since it was definitely hard to track this one down.

<Provider store={store}>
  <ConnectedRouter history={history}>
    <Router>
      <App />
    </Router>
  </ConnectedRouter>
</Provider>

should be

<Provider store={store}>
  <ConnectedRouter history={history}>
    <App />
  </ConnectedRouter>
</Provider>

Not sure if the nested Router is entirely unintended or vestigial of an older version's intended setup, but killing it fixes the issue of URL changing on <Link to="/path" /> or useHistory().push("/path") but the app not registering or rendering any changes

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