Skip to content

Commit

Permalink
add <thead>, <tfoot> to table > tr warning (#16535)
Browse files Browse the repository at this point in the history
  • Loading branch information
tomquirk authored and trueadm committed Aug 29, 2019
1 parent 37fcd04 commit 557d472
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/react-dom/src/__tests__/ReactDOMComponent-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -1713,7 +1713,7 @@ describe('ReactDOMComponent', () => {

expect(() => ReactTestUtils.renderIntoDocument(<Foo />)).toWarnDev([
'Warning: validateDOMNesting(...): <tr> cannot appear as a child of ' +
'<table>. Add a <tbody> to your code to match the DOM tree generated ' +
'<table>. Add a <tbody>, <thead> or <tfoot> to your code to match the DOM tree generated ' +
'by the browser.' +
'\n in tr (at **)' +
'\n in Row (at **)' +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ describe('validateDOMNesting', () => {
['table', 'tr'],
[
'validateDOMNesting(...): <tr> cannot appear as a child of <table>. ' +
'Add a <tbody> to your code to match the DOM tree generated by the browser.\n' +
'Add a <tbody>, <thead> or <tfoot> to your code to match the DOM tree generated by the browser.\n' +
' in tr (at **)',
],
);
Expand Down
2 changes: 1 addition & 1 deletion packages/react-dom/src/client/validateDOMNesting.js
Original file line number Diff line number Diff line change
Expand Up @@ -458,7 +458,7 @@ if (__DEV__) {
let info = '';
if (ancestorTag === 'table' && childTag === 'tr') {
info +=
' Add a <tbody> to your code to match the DOM tree generated by ' +
' Add a <tbody>, <thead> or <tfoot> to your code to match the DOM tree generated by ' +
'the browser.';
}
warningWithoutStack(
Expand Down

0 comments on commit 557d472

Please sign in to comment.