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

fix: memoize Suspense readiness to avoid rerendering children/fallback #1642

Merged
merged 1 commit into from
Sep 4, 2023

Conversation

gbj
Copy link
Collaborator

@gbj gbj commented Sep 3, 2023

Digging into issue #1629 I found that the switch between children and fallback is being re-triggered every time the Suspense count changes, not only when it switches between loading and readiness. This is a problem if multiple resources are read. I think I've fixed this by just memoizing that check.

@sebadob
Copy link
Contributor

sebadob commented Sep 3, 2023

I just tested it and this fixes #1629 for me.

@gbj gbj merged commit 2ca2488 into main Sep 4, 2023
54 checks passed
@gbj gbj deleted the 1629 branch September 4, 2023 00:07
@gbj
Copy link
Collaborator Author

gbj commented Sep 4, 2023

Excellent, thanks for confirming that.

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