Skip to content

Commit 23496c1

Browse files
committed
Warn if <Routes> is inside some other component's render method
1 parent 45d17ba commit 23496c1

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

modules/components/Routes.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -230,8 +230,9 @@ var Routes = React.createClass({
230230

231231
componentDidMount: function () {
232232
warning(
233-
this.getDOMNode() == null || this.getDOMNode().parentNode === document.body,
234-
'<Routes> should probably be the outermost component on the page'
233+
this._owner == null,
234+
'<Routes> should be rendered directly using React.renderComponent, not ' +
235+
'inside some other component\'s render method'
235236
);
236237

237238
if (this._handleStateChange) {

0 commit comments

Comments
 (0)