Skip to content

Commit b60b5ea

Browse files
committed
fix: don't allow match on root unamed node
1 parent 8fb183d commit b60b5ea

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

modules/RouteNode.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,10 @@ export default class RouteNode {
197197
let segments = [];
198198
segments.params = {};
199199

200-
return matchChildren(startingNodes, path, segments);
200+
const matched = matchChildren(startingNodes, path, segments);
201+
if (matched && matched.length === 1 && matched[0].name === '') return null;
202+
203+
return matched;
201204
}
202205

203206
getPathFromSegments(segments) {

0 commit comments

Comments
 (0)