-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Ignore dangerouslySetInnerHTML during hydration #1595
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
Looks like we'd need to remove the |
Might be worth adding a warning via preact/debug for this too. |
Hey @developit, I updated the test that was failing and I was trying to see if I could add the warning part. But no idea how to detect this case, inside |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sweet! I think we can merge it without changes to preact/debug
. Those are imo low priority and can happen in a separate PR if needed 🎉
Hey @developit Is the intention to avoid reaplying innerHTML, or is it to strip away the content of VNodes with dangerouslySetInnerHTML? When using SSR the current solution strips away all content rendered with dangerouslySetInnerHTML during hydration. This breaks 10.0.0-beta.2 for us. We use dangerouslySetInnerHTML to render content from our CMS (and have been doing so for years). It renders perfectly on the server, but after 10.0.0-beta.2 the content is stripped away during hydration, essentially leaving the application blank. |
@johannesodland Our future approach will to only attach event listeners in hydration and leave the DOM as is. That work is tracked in #1697 |
This matches React's behavior.
I can't find the issue right now but I will.