add <thead>, <tfoot> to table > tr warning (#16535)
Tom Quirk committed
Aug 29, 2019 at 23:46 UTC
557d472fe3d48f3c5e92116e614e83a415e21f18
3 files changed
+3
-3
packages/react-dom/src/__tests__/ReactDOMComponent-test.js
+1
-1
@@ -1713,7 +1713,7 @@ describe('ReactDOMComponent', () => {
1713
1714
expect(() => ReactTestUtils.renderIntoDocument(<Foo />)).toWarnDev([
1715
'Warning: validateDOMNesting(...): <tr> cannot appear as a child of ' +
1716
- '<table>. Add a <tbody> to your code to match the DOM tree generated ' +
1716
+ '<table>. Add a <tbody>, <thead> or <tfoot> to your code to match the DOM tree generated ' +
1717
'by the browser.' +
1718
'\n in tr (at **)' +
1719
'\n in Row (at **)' +
packages/react-dom/src/__tests__/validateDOMNesting-test.js
+1
-1
@@ -81,7 +81,7 @@ describe('validateDOMNesting', () => {
81
['table', 'tr'],
82
[
83
'validateDOMNesting(...): <tr> cannot appear as a child of <table>. ' +
84
- 'Add a <tbody> to your code to match the DOM tree generated by the browser.\n' +
84
+ 'Add a <tbody>, <thead> or <tfoot> to your code to match the DOM tree generated by the browser.\n' +
85
' in tr (at **)',
86
],
87
);
packages/react-dom/src/client/validateDOMNesting.js
+1
-1
@@ -458,7 +458,7 @@ if (__DEV__) {
458
let info = '';
459
if (ancestorTag === 'table' && childTag === 'tr') {
460
info +=
461
- ' Add a <tbody> to your code to match the DOM tree generated by ' +
461
+ ' Add a <tbody>, <thead> or <tfoot> to your code to match the DOM tree generated by ' +
462
'the browser.';
463
}
464
warningWithoutStack(