Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Warn when rendering into React-rendered child that isn't a root
  • Loading branch information
acdlite committed Feb 2, 2017
commit f4823295af9792c2ef6e0e7da6a4628009dd227d
9 changes: 9 additions & 0 deletions src/renderers/dom/fiber/ReactDOMFiber.js
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,15 @@ var ReactDOM = {
}

if (__DEV__) {
warning(
!ReactDOMComponentTree.getInstanceFromNode(container) ||
container._reactRootContainer,
'render(...): Replacing React-rendered children with a new root ' +
'component. If you intended to update the children of this node, ' +
'you should instead have the existing children update their state ' +
'and render the new components instead of calling ReactDOM.render.'
);

warning(
!container.tagName || container.tagName.toUpperCase() !== 'BODY',
'render(): Rendering components directly into document.body is ' +
Expand Down