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

client.js:1 Warning: Cannot update a component (Home) while rendering a different component (App). To locate the bad setState() call inside App #545

Open
haar1shKhan opened this issue May 20, 2023 · 5 comments
Labels

Comments

@haar1shKhan
Copy link

haar1shKhan commented May 20, 2023

Update issue when changing routes

.
i have two routes in the my program which uses SSR and inside SSR funtion of first route (Home) dispatches a asyncthunk function which fetches a details about api and in second route (projects) dispatches a async function whichs fetches a detail about all the projects i have done. the details in each pages are hydrated but problem arises when i switch from one route to another using link component.
image

@hitendra-ap
Copy link

hitendra-ap commented Jun 19, 2023

I am also getting this error on local. @kirill-konshin Any eta on this bug ?

@jkesseler
Copy link

This PR seems to fix it: #540

@doshdik
Copy link

doshdik commented Jul 22, 2023

+1 here, exact same case and error. Btw if you are looking for fix, you can switch to pre-release version 9.0.0-rc2.
You will need to do some refactoring, cause 9.0 has some changes in core concepts, but in the end it looks more straitforward in terms of getServerSideProps and store sync between server and client.
https://github.com/kirill-konshin/next-redux-wrapper/tree/9.0.0-rc.2#readme

@DanielOrtel
Copy link
Contributor

I had the same issue, and it turned out that I was incorrectly memoizing my selectors/not memoizing my selectors. I'd recommend you try to add proxy-memoize, which IMO, is a much better experience and overall more robust than reselect, and see if the error still persists.

@dovranJorayev
Copy link

This PR seems to fix it: #540

Yep, definitely. But need to clone forked repo, build it locally and patch node_modules. Then issue resolves. I believe it will be great to merge this PR. @kirill-konshin and thanks for awesome lib

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

No branches or pull requests

6 participants