File tree Expand file tree Collapse file tree 1 file changed +6
-9
lines changed
packages/react-router/modules Expand file tree Collapse file tree 1 file changed +6
-9
lines changed Original file line number Diff line number Diff line change @@ -3,11 +3,6 @@ import invariant from "invariant";
3
3
import React from "react" ;
4
4
import PropTypes from "prop-types" ;
5
5
6
- function is16Plus ( ) {
7
- const [ major ] = React . version . split ( '.' ) ;
8
- return parseInt ( major ) >= 16 ;
9
- }
10
-
11
6
/**
12
7
* The public API for putting history on context.
13
8
*/
@@ -55,9 +50,11 @@ class Router extends React.Component {
55
50
const { children, history } = this . props ;
56
51
57
52
invariant (
58
- is16Plus ( ) || children == null || React . Children . count ( children ) === 1 ,
59
- 'A <Router> may have only one child element'
60
- )
53
+ React . Fragment !== undefined ||
54
+ children == null ||
55
+ React . Children . count ( children ) === 1 ,
56
+ "A <Router> may have only one child element"
57
+ ) ;
61
58
62
59
// Do this here so we can setState when a <Redirect> changes the
63
60
// location in componentWillMount. This happens e.g. when doing
@@ -81,7 +78,7 @@ class Router extends React.Component {
81
78
}
82
79
83
80
render ( ) {
84
- return this . props . children || null
81
+ return this . props . children || null ;
85
82
}
86
83
}
87
84
You can’t perform that action at this time.
0 commit comments