diff --git a/src/renderers/dom/client/__tests__/validateDOMNesting-test.js b/src/renderers/dom/client/__tests__/validateDOMNesting-test.js index e0bdfe959f2bc..b8b901e6aae2e 100644 --- a/src/renderers/dom/client/__tests__/validateDOMNesting-test.js +++ b/src/renderers/dom/client/__tests__/validateDOMNesting-test.js @@ -83,5 +83,8 @@ describe('ReactContextValidator', function() { expect(isTagStackValid(['table', 'tr'])).toBe(false); expect(isTagStackValid(['div', 'ul', 'li', 'div', 'li'])).toBe(false); expect(isTagStackValid(['div', 'html'])).toBe(false); + + expect(isTagStackValid(['body', 'body'])).toBe(false); + expect(isTagStackValid(['svg', 'foreignObject', 'body', 'p'])).toBe(false); }); }); diff --git a/src/renderers/dom/client/validateDOMNesting.js b/src/renderers/dom/client/validateDOMNesting.js index 431d80fd2d5db..a8c808f4d60eb 100644 --- a/src/renderers/dom/client/validateDOMNesting.js +++ b/src/renderers/dom/client/validateDOMNesting.js @@ -220,6 +220,8 @@ if (__DEV__) { case 'th': case 'thead': case 'tr': + + case 'body': // These tags are only valid with a few parents that have special child // parsing rules -- if we're down here, then none of those matched and // so we allow it only if we don't know what the parent is, as all other