-
Beta Was this translation helpful? Give feedback.
Answered by
icyJoseph
Nov 12, 2025
Replies: 1 comment 11 replies
-
|
Share some pseudo-code of what you are doing, or better yet a repository. |
Beta Was this translation helpful? Give feedback.
11 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment




AHa yeah HTML is kind of forgiving, but not... like you can't nest
ptags in server sent HTML at least, and yeah in general weird things may happen when the browser HTML parser re-orders the HTML into a valid shape.It is not Next.js making decisions about this btw, React does some validation, but it is not complete, acknowledged in the source code of React. Since you are sending invalid HTML in the dangerouslySetInnerHTML bit, all guards are off - the browser parser re-arranges the HTML and React runs into hydration issues, possibly leading duplicate nodes, or nodes in unexpected places.
See here, I did this in a codepen project. Notice the output is not what you'd expect. This tool is a…