From 6d1ae954112227edf91ca1d7ab3bbc29c70d9f91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anders=20A=CC=8Aberg?= Date: Thu, 14 Aug 2014 09:37:40 +0200 Subject: [PATCH] [fixed] sibling array route configs now you can configure your routes like this: ```js var extraRoutes = [, ]; var routes = ( {extraRoutes} ); ``` closes #193 --- modules/components/Routes.js | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/modules/components/Routes.js b/modules/components/Routes.js index 97ad122033..0c48a510d6 100644 --- a/modules/components/Routes.js +++ b/modules/components/Routes.js @@ -242,7 +242,21 @@ function Redirect(to, params, query) { this.query = query; } -function findMatches(path, route) { +function findMatches(path,route){ + var matches = null; + + if (Array.isArray(route)) { + for (var i = 0, len = route.length; matches == null && i < len; ++i) { + matches = findMatches(path, route[i]); + } + } else { + matches = findMatchesForRoute(path,route); + } + + return matches; +} + +function findMatchesForRoute(path, route) { var children = route.props.children, matches; var params;