Skip to content

Commit 585d8ec

Browse files
committed
[fixed] Use more correct children invariant
1 parent d69f1c1 commit 585d8ec

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

modules/Routing.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ function createRoute(element, parentRoute, namedRoutes) {
8989
);
9090

9191
invariant(
92-
props.children == null,
92+
React.Children.count(props.children) === 0,
9393
'<NotFoundRoute> must not have children'
9494
);
9595

@@ -111,7 +111,7 @@ function createRoute(element, parentRoute, namedRoutes) {
111111
);
112112

113113
invariant(
114-
props.children == null,
114+
React.Children.count(props.children) === 0,
115115
'<DefaultRoute> must not have children'
116116
);
117117

0 commit comments

Comments
 (0)