Skip to content

Commit 557d472

Browse files
tomquirktrueadm
authored andcommitted
add <thead>, <tfoot> to table > tr warning (#16535)
1 parent 37fcd04 commit 557d472

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

packages/react-dom/src/__tests__/ReactDOMComponent-test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1713,7 +1713,7 @@ describe('ReactDOMComponent', () => {
17131713

17141714
expect(() => ReactTestUtils.renderIntoDocument(<Foo />)).toWarnDev([
17151715
'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 ' +
17171717
'by the browser.' +
17181718
'\n in tr (at **)' +
17191719
'\n in Row (at **)' +

packages/react-dom/src/__tests__/validateDOMNesting-test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ describe('validateDOMNesting', () => {
8181
['table', 'tr'],
8282
[
8383
'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' +
8585
' in tr (at **)',
8686
],
8787
);

packages/react-dom/src/client/validateDOMNesting.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -458,7 +458,7 @@ if (__DEV__) {
458458
let info = '';
459459
if (ancestorTag === 'table' && childTag === 'tr') {
460460
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 ' +
462462
'the browser.';
463463
}
464464
warningWithoutStack(

0 commit comments

Comments
 (0)