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

[React 19] Prewarm with use() broken in certain state-change situations in the parent #31566

Open
Ephem opened this issue Nov 17, 2024 · 1 comment

Comments

@Ephem
Copy link
Contributor

Ephem commented Nov 17, 2024

Summary

When testing the new prewarming, I ran across a situation where an effect / state change in the parent seems to break prewarming. This only happens with use(), not with throw promise:

https://codesandbox.io/p/sandbox/sibling-suspense-use-reproduction-lmscnl

I have not explored exactly under which circumstances this happens.

I did not find this in a real app, it happened when I was testing edge cases with React Query and noticed useSuspenseQuery worked as expected (throw promise) and { promise } = useQuery(...); use(promise) did not in one case.

I am not sure this is a bug or intentional behaviour, but wanted to file it since it behaves differently with use(promise) and throw promise.

@aalmanasir
Copy link

Bug

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

No branches or pull requests

3 participants