Skip to content

Commit 45d17ba

Browse files
committed
Add warning about <Routes> DOM placement
1 parent 5e5ec5c commit 45d17ba

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

modules/components/Routes.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,11 @@ var Routes = React.createClass({
229229
},
230230

231231
componentDidMount: function () {
232+
warning(
233+
this.getDOMNode() == null || this.getDOMNode().parentNode === document.body,
234+
'<Routes> should probably be the outermost component on the page'
235+
);
236+
232237
if (this._handleStateChange) {
233238
this._handleStateChange();
234239
delete this._handleStateChange;

0 commit comments

Comments
 (0)