-
Notifications
You must be signed in to change notification settings - Fork 593
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
Redirection not work after action #230
Comments
Try to update connected-react-router to v6.2.1 and wrap your App component in Route <ConnectedRouter history={history}>
<Route path="/" component={App} />
</ConnectedRouter> |
@Funkyskank I am experiencing the same issue and updating to v6.2.1 didn't help with the problem. |
@damian66 and @Funkyskank Just now I have resolve the problem only doing a new setup of the project I think that is a problem with the order of my import but I am investigating about that. Thanks. |
Similar problem under v6.2.1. Locking connected-react-router to v6.0.0 helps me. |
I had the same problem in a monorepo, I installed version 6.2.2 everywhere so that there is only one version and it worked. |
I seem to be having the same problem.
I have tried locking to "connected-react-router": "6.0.0"... to no avail. |
Same problem here |
I have the same issue. Downgrade to v6.0.0 fixed the problem. |
I'm having the same issue. Location got changed but component isn't loading. EDIT: |
I had a same problem. This was indeed very simple problem. I looked at the installation steps and found that I was using BrowserRouter under ConnectedRouter Router.jsconst Router = () => {
return (
<BrowserRouter>
<React.Suspense fallback={Loading}>
<Switch>
<Route exact path={ROUTER_ROOT} component={HomePage} />
</Switch>
</React.Suspense>
</BrowserRouter>
);
}; index.jsif (root) {
ReactDOM.render(
<Provider store={store}>
<ConnectedRouter history={history}>
<Router />
</ConnectedRouter>
</Provider>,
root
);
} |
so is the provided code the solution or the problem code? Anyway I'm getting a similar issue... yield(put(push('/location'))) in a saga will change the url, but not rerender. The location in the store is changed (can see the change via selectors) but component doesn't seem to be picking up this change (in the react inspector, it shows the previous location in the context). However, if I yield(put(push('/location'))) twice, or if I simply dispatch(push('/location')) from a component, it works properly. The only difference in my setup is that I am using Switch and Route from react-router-dom instead of react-router. Also using 'connected-react-router/immutable' imports. This seems to have broken only recently (since 6.2.1? I was running my own fork of it with the immutable fix).
|
I found the solution. I have replaced some Components classes to PureComponent. |
Dealt with this issue in version 6.3.1 with react-router-dom@4.3.1 The following previously stated answers did not fix it for me:
What did fix it for me was downgrading to version 6.0.0. After the downgrade I was able to revert all other changes, including running PureComponents as containers not wrapped with |
@foodforarabbit that's problem code.
The application state was incorrectly not updating:
But after removing the nested
|
Oh that code isn't mine, I was just quoting the guy above me. The problem seems to have gone away on my end, not sure if I upgraded a package and it fixed itself or what happened. Recently, I upgraded react-router-dom from 4.3.1 to 4.4.0-beta.7 (connected-react-router is at 6.3.2). However, I haven't really been testing it extensively so I'm not entirely sure if the problem has gone away - if anything changes I'll try to post an update here or something. |
I have same issue, the installations step seems to be ok (connectedRouter is present and hasn't other router below, no pureComponenet are used, component are wrapped in withRouter), i see the action correctly dispatched but the state router is not updated (and of course also url and page content are not updated) same for push and goBack
package.json
|
fyi my package.json
Try upgrading your react-router-dom package actually, that was one of my last upgrades. |
I already try but the issue is still there |
Locking connected-react-router to v6.0.0 also helps me, but want to know what happened |
This is still happening in v6.8.0. Downgrading to v6.0.0 was the solution, but like everyone else, I'd like to know why |
I tried all the above yet not working. I managed to downgrade the react-router-dom version. But no valid for me. I believe this is more than a major BUG, I have two projects separated each and one is working and the other not. Weird :( |
Same here. I also installed unnecessary peer dependencies just to be sure
|
Thank you so much, I made the same mistake and this solved the problem! |
Hi, I have using connected-react-router 6.1.0 in my react project stack.
react -> 16.7.0
react-router-dom -> 4.3.1
react-redux -> 6.0.0
redux-thunk -> 2.3.0
I have configurated my app, and router works perfectly (I can use the Redirect component from react-router). The problem that I have detected is produced when I am doing an API call (action) and before I want to redirect (promise finish). I don´t know why the location path change to the right URL but the page component not is loaded, (If I reload the page I can continue).
Example:
Anyone can help me, please?
The text was updated successfully, but these errors were encountered: