-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
🐛 BUG: React component hydration error when loaded with client:only
#3010
Comments
Thanks! can you submit a PR for this? |
Looks like this also causes a similar warning in Vue,
|
I get the same warning @matthewp with vue, but I cannot PR it though 🙈. |
I managed to reproduce the issue https://youtu.be/kSgRvK0xWLw?t=6965 The solution is to remove |
@JLarky Dang, thanks for the detailed livestream there! Almost feels unfair making the PR myself here since you explained it so well... definitely feel free to contribute in the future, but I have a PR coming in 👍 |
haha, thanks :) I would definitely help with the code if I had more time :) but I appreciate the kind words about the video :) |
@JLarky Well, I spoke too soon there. We actually avoid using |
right, that's what I was talking about :) you have to intelligently use one or the other, otherwise, it will either be not working (doing |
@JLarky Correct, that's what I implemented! I just got some conflicting feedback from the team about whether |
Hey guys issue is back? Static exported build got same error with hydration in two different projects |
Hello, Same error Astro 4.12.1 |
@julien-e open a new issue |
What version of
astro
are you using?1.0.0-beta.2
What package manager are you using?
npm
What operating system are you using?
Mac
Describe the Bug
@astrojs/react
:0.1.0
React components loaded with
client:only
show a hydration error:The component still works, it just makes React unhappy.
client:only
skips the component at build time, so there's nothing to hydrate. React components rendered withclient:only
should probably usecreateRoot
instead ofhydrateRoot
:astro/packages/integrations/react/client.js
Line 6 in 1335797
Though in looking at the code, there is a
suppressHydrationWarning
flag - is that related?:astro/packages/integrations/react/client.js
Line 10 in 1335797
Link to Minimal Reproducible Example
https://stackblitz.com/edit/github-2hpcon
Participation
The text was updated successfully, but these errors were encountered: