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

Upgrade packages and add data reconciliation to RTK app #519

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

voinik
Copy link
Contributor

@voinik voinik commented Jan 7, 2023

It turns out that React 18+ and/or Next 13+ no longer allow our useMemo solution to always work properly. In the previous versions, when doing client side routing, React would not rerender the currently mounted components after we hydrated, and would instead directly mount the new components for the new page. In React 18+ and Next 13+, that's no longer the case. React now does rerender the currently mounted components before mounting the new page components. At least that's what happened in the RTK demo app in this repo.

This means users probably have to do data reconciliation if their old page has selectors in them.

As discussed before, this won't happen on every page on every client side routing event, but it may happen sometimes. I don't know what it depends on, but I think it's best if users always do it.

Note that this has already been happening to users that are already on React 18+ and/or Next 13+, so this package upgrade PR won't affect anything. These problems already exist.

The only thing we probably need to do is inform users that they have to do data reconciliation (if they run into this issue).

@felpsio
Copy link

felpsio commented Jan 11, 2023

This PR seems very important to who is using the latest React and NextJS version. I'm having reconciliation problems on my app. I hope this can be properly reviewed and merged soon :)

@voinik
Copy link
Contributor Author

voinik commented Jan 11, 2023

This PR seems very important to who is using the latest React and NextJS version. I'm having reconciliation problems on my app. I hope this can be properly reviewed and merged soon :)

@felpsio Thanks for the comment. Just FYI, this PR won't change anything for consumers. All consumer will have to do data reconciliation themselves.

This PR is basically just updating the examples to show how to use this package with the newest React and Next versions.

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

Successfully merging this pull request may close these issues.

2 participants