-
Notifications
You must be signed in to change notification settings - Fork 46.7k
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
dangerouslySetInnerHTML is left empty on client render on top of bad server markup when rendering HTML #15171
Comments
Do you want to try to fix it? |
@gaearon sure! :) Already dove into it a bit |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contribution. |
Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please create a new issue with up-to-date information. Thank you! |
Still relevant? |
I think i may have ran into this today. Haven't done that much research, and i'm pretty new in the react world. Is there any kind of work around? |
Sorry, I forgot totally about this... |
Hmm ... but im not sure it was this for me. Or it seemed that i tried to render a |
I think I may be hitting this issue with a Gatsby site. I will see if I can create a streamlined version of the site that can reliably recreate the issue and I will share that as a debugging tool. React v16.13.1 Edit: What @olaj mentioned seems to fix the issue in my case |
I hit this issue today and here's a quick repro. I'm not completely sure about what the desired behavior should be here, as nesting paragraph elements isn't compliant with HTML5's spec. Using straight JSX produces the "desired" output, even though incorrect On the other hand, using |
Could somebody please provide a sandbox showing the issue? |
Re: #15171 (comment) There is a console error explaining that you're rendering invalid markup: That's why it doesn't work. |
This seems to be an edge case of #11789 fixed in https:/facebook/react/pull/13353/files.
I ran into this when trying to hydrate content rendered with https:/prismicio/prismic-dom
asHtml
method.Do you want to request a feature or report a bug?
Bug? I think.
What is the current behavior?
Current behavior:
I tried to replicate the issue on https://codesandbox.io/s/2xojk10jln but failed.
The following testcase for
packages/react-dom/src/__tests__/ReactDOMServerIntegrationElements-test.js
produces the same result (I tried it first with the same PrismicDOM.RichText.asHtml(obj) call I have in the app) but I am not sure if it's correct:What is the expected behavior?
The client render would have rendered
<li>bar</li>
Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?
commit c05b4b8 (latest master) and >16.8.
Sorry for a bit vague bug report.
The text was updated successfully, but these errors were encountered: