Skip to content

fix: #443 useSyncEffect Breaks useFind Reactivity Under Suspense#438

Merged
nachocodoner merged 1 commit intometeor:masterfrom
welkinwong:master
Apr 16, 2025
Merged

fix: #443 useSyncEffect Breaks useFind Reactivity Under Suspense#438
nachocodoner merged 1 commit intometeor:masterfrom
welkinwong:master

Conversation

@welkinwong
Copy link
Contributor

In the client-side implementation of suspense/useFind, useFindClient is used. PR #418 introduced useSyncEffect.

Nevertheless, when used in Strict Mode and with Suspense, the useSyncEffect implementation results in non-trivial and hard-to-predict issues.

As a result, the Suspense-enabled useFindSuspenseClient will no longer reference useFindClient and will instead be a standalone implementation (derived from the last stable version of useFindClient).

Note: The #418 test case issue does not occur with React 18/19's createRoot when using Suspense (the test passes normally in this configuration).

@welkinwong
Copy link
Contributor Author

Snipaste_2025-04-12_23-30-42

In the client-side implementation of suspense/useFind, useFindClient is used. PR #433 introduced useSyncEffect.
Nevertheless, when used in Strict Mode and with Suspense, the useSyncEffect implementation results in non-trivial and hard-to-predict issues.
As a result, the Suspense-enabled useFindSuspenseClient will no longer reference useFindClient and will instead be a standalone implementation (derived from the last stable version of useFindClient).
@nachocodoner
Copy link
Member

I found an infinite render loop error while testing the new beta of react-meteor-data. It happens in a use case with Suspense. I'd like to check if this update fixes it.

image

@nachocodoner
Copy link
Member

Merging this since I confirm the fix. Will publish a beta soon. Thanks a lot for the detailed PRs and focus on these issues.

@nachocodoner nachocodoner merged commit 874c269 into meteor:master Apr 16, 2025
2 checks passed
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.

#443 useSyncEffect Breaks useFind Reactivity Under Suspense

2 participants