.\n' +
+ 'This will cause a hydration error.' +
'\n in tr (at **)' +
'\n in div (at **)',
]);
@@ -2208,8 +2209,9 @@ describe('ReactDOMComponent', () => {
);
});
}).toErrorDev(
- 'Warning:
cannot appear as a descendant ' +
- 'of
.' +
+ 'Warning: In HTML,
cannot be a descendant ' +
+ 'of
.\n' +
+ 'This will cause a hydration error.' +
// There is no outer `p` here because root container is not part of the stack.
'\n in p (at **)' +
'\n in span (at **)',
@@ -2241,22 +2243,25 @@ describe('ReactDOMComponent', () => {
root.render();
});
}).toErrorDev([
- 'Warning:
cannot appear as a child of ' +
+ 'Warning: In HTML,
cannot be a child of ' +
'
. Add a , or to your code to match the DOM tree generated ' +
- 'by the browser.' +
+ 'by the browser.\n' +
+ 'This will cause a hydration error.' +
'\n in tr (at **)' +
'\n in Row (at **)' +
'\n in table (at **)' +
'\n in Foo (at **)',
- 'Warning: Text nodes cannot appear as a ' +
- 'child of
.' +
+ 'Warning: In HTML, text nodes cannot be a ' +
+ 'child of
.\n' +
+ 'This will cause a hydration error.' +
'\n in tr (at **)' +
'\n in Row (at **)' +
'\n in table (at **)' +
'\n in Foo (at **)',
- 'Warning: Whitespace text nodes cannot ' +
- "appear as a child of
. Make sure you don't have any extra " +
- 'whitespace between tags on each line of your source code.' +
+ 'Warning: In HTML, whitespace text nodes cannot ' +
+ "be a child of
. Make sure you don't have any extra " +
+ 'whitespace between tags on each line of your source code.\n' +
+ 'This will cause a hydration error.' +
'\n in table (at **)' +
'\n in Foo (at **)',
]);
@@ -2283,9 +2288,10 @@ describe('ReactDOMComponent', () => {
root.render();
});
}).toErrorDev([
- 'Warning: Whitespace text nodes cannot ' +
- "appear as a child of
. Make sure you don't have any extra " +
- 'whitespace between tags on each line of your source code.' +
+ 'Warning: In HTML, whitespace text nodes cannot ' +
+ "be a child of
. Make sure you don't have any extra " +
+ 'whitespace between tags on each line of your source code.\n' +
+ 'This will cause a hydration error.' +
'\n in table (at **)' +
'\n in Foo (at **)',
]);
@@ -2311,8 +2317,9 @@ describe('ReactDOMComponent', () => {
);
});
}).toErrorDev([
- 'Warning: Text nodes cannot appear as a ' +
- 'child of
.' +
+ 'Warning: In HTML, text nodes cannot be a ' +
+ 'child of
.\n' +
+ 'This will cause a hydration error.' +
'\n in tr (at **)' +
'\n in Row (at **)' +
'\n in tbody (at **)' +
diff --git a/packages/react-dom/src/__tests__/ReactDOMFloat-test.js b/packages/react-dom/src/__tests__/ReactDOMFloat-test.js
index 64f79140917c8..31c1607cc149c 100644
--- a/packages/react-dom/src/__tests__/ReactDOMFloat-test.js
+++ b/packages/react-dom/src/__tests__/ReactDOMFloat-test.js
@@ -523,7 +523,7 @@ describe('ReactDOMFloat', () => {
}).toErrorDev(
[
'Cannot render