From 1c1719807e323e25ad1b587dca366efa1da718d4 Mon Sep 17 00:00:00 2001 From: Brett Sun Date: Wed, 3 Feb 2016 12:28:49 +0100 Subject: [PATCH] Use previous method from white labels to get the current active route --- js/components/app_base.js | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/js/components/app_base.js b/js/components/app_base.js index de1aab71..c188e628 100644 --- a/js/components/app_base.js +++ b/js/components/app_base.js @@ -37,13 +37,11 @@ export default function AppBase(App) { }, render() { - const { children } = this.props; + const { routes } = this.props; - // Get the currently active route of the app by using the injected route parameter - // on the currently active child route. - // Note that despite its name, this.props.children can only ever be a single - // React.PropTypes.element. - const activeRoute = children.props.route; + // The second element of the routes prop given to us by react-router is always the + // active second-level component object (ie. after App). + const activeRoute = routes[1]; return (