-
Notifications
You must be signed in to change notification settings - Fork 47.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
[Fiber][Dev] Relax dom nesting validation when the root is a Document, html tag, or body tag #32252
Conversation
Comparing: b48e739...365cde6 Critical size changesIncludes critical production bundles, as well as any change greater than 2%:
Significant size changesIncludes any change greater than 0.2%: (No significant changes) |
aee09bb
to
163de10
Compare
163de10
to
8d78e37
Compare
8d78e37
to
aa7b5bd
Compare
aa7b5bd
to
c30cf4c
Compare
c15858c
to
2d56804
Compare
2d56804
to
8ebfb85
Compare
8ebfb85
to
ecf43ac
Compare
ecf43ac
to
49e0fae
Compare
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.
Great test coverage.
@@ -138,6 +164,49 @@ describe('validateDOMNesting', () => { | |||
'In HTML, <body> cannot be a child of <body>.\n' + | |||
'This will cause a hydration error.\n' + | |||
' in body (at **)', | |||
'You are mounting a new body component when a previous one has not first unmounted.', |
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.
Any chance we can skip this when we already warned about body > body
?
in react-dom in Dev we validate that the tag nesting is valid. This is motivated primarily because while browsers are tolerant to poor HTML there are many cases that if server rendered will be hydrated in a way that will break hydration. With the changes to singleton scoping where the document body is now the implicit render/hydration context for arbitrary tags at the root we need to adjust the validation logic to allow for valid programs such as rendering divs as a child of a Document (since this div will actually insert into the body).
49e0fae
to
0a749ef
Compare
…, html tag, or body tag (#32252) followup to * #32069 * #32163 * #32224 in react-dom in Dev we validate that the tag nesting is valid. This is motivated primarily because while browsers are tolerant to poor HTML there are many cases that if server rendered will be hydrated in a way that will break hydration. With the changes to singleton scoping where the document body is now the implicit render/hydration context for arbitrary tags at the root we need to adjust the validation logic to allow for valid programs such as rendering divs as a child of a Document (since this div will actually insert into the body). DiffTrain build for [a0fdb63](a0fdb63)
…, html tag, or body tag (#32252) followup to * #32069 * #32163 * #32224 in react-dom in Dev we validate that the tag nesting is valid. This is motivated primarily because while browsers are tolerant to poor HTML there are many cases that if server rendered will be hydrated in a way that will break hydration. With the changes to singleton scoping where the document body is now the implicit render/hydration context for arbitrary tags at the root we need to adjust the validation logic to allow for valid programs such as rendering divs as a child of a Document (since this div will actually insert into the body). DiffTrain build for [a0fdb63](a0fdb63)
…, html tag, or body tag (facebook#32252) followup to * facebook#32069 * facebook#32163 * facebook#32224 in react-dom in Dev we validate that the tag nesting is valid. This is motivated primarily because while browsers are tolerant to poor HTML there are many cases that if server rendered will be hydrated in a way that will break hydration. With the changes to singleton scoping where the document body is now the implicit render/hydration context for arbitrary tags at the root we need to adjust the validation logic to allow for valid programs such as rendering divs as a child of a Document (since this div will actually insert into the body). DiffTrain build for [a0fdb63](facebook@a0fdb63)
…, html tag, or body tag (facebook#32252) followup to * facebook#32069 * facebook#32163 * facebook#32224 in react-dom in Dev we validate that the tag nesting is valid. This is motivated primarily because while browsers are tolerant to poor HTML there are many cases that if server rendered will be hydrated in a way that will break hydration. With the changes to singleton scoping where the document body is now the implicit render/hydration context for arbitrary tags at the root we need to adjust the validation logic to allow for valid programs such as rendering divs as a child of a Document (since this div will actually insert into the body). DiffTrain build for [a0fdb63](facebook@a0fdb63)
followup to
in react-dom in Dev we validate that the tag nesting is valid. This is motivated primarily because while browsers are tolerant to poor HTML there are many cases that if server rendered will be hydrated in a way that will break hydration.
With the changes to singleton scoping where the document body is now the implicit render/hydration context for arbitrary tags at the root we need to adjust the validation logic to allow for valid programs such as rendering divs as a child of a Document (since this div will actually insert into the body).