Skip to content

Commit

Permalink
allow null children for Router
Browse files Browse the repository at this point in the history
  • Loading branch information
Pavel Aksonov committed Sep 21, 2018
1 parent e789438 commit 0f6cc9b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/navigationStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -673,7 +673,7 @@ class NavigationStore {
}
// add all clones
for (const child of children) {
if (child.props.clone) {
if (child && child.props.clone) {
if (clones.indexOf(child) === -1) {
clones.push(child);
}
Expand All @@ -682,6 +682,10 @@ class NavigationStore {
let initialRouteName;
let initialRouteParams;
for (const child of children) {
// allow null/false child, useful for conditionals
if (!child) {
continue;
}
const key = child.key || `key${(counter += 1)}`;
const init = key === children[0].key;
assert(reservedKeys.indexOf(key) === -1, `Scene name cannot be reserved word: ${child.key}`);
Expand Down

0 comments on commit 0f6cc9b

Please sign in to comment.