diff --git a/js/components/whitelabel/prize/portfolioreview/pr_app.js b/js/components/whitelabel/prize/portfolioreview/pr_app.js index c738c0bd..73df2766 100644 --- a/js/components/whitelabel/prize/portfolioreview/pr_app.js +++ b/js/components/whitelabel/prize/portfolioreview/pr_app.js @@ -61,10 +61,7 @@ let PRApp = React.createClass({ const { activeRoute, children, history, routes } = this.props; const { currentUser } = this.state; const subdomain = getSubdomain(); - - // The second element of routes is always the active component object, where we can - // extract the path. - const path = routes[1] ? routes[1].path : null; + const path = activeRoute && activeRoute.path; let style = {}; let header; diff --git a/js/components/whitelabel/prize/simple_prize/prize_app.js b/js/components/whitelabel/prize/simple_prize/prize_app.js index e3f1e290..97ccb53c 100644 --- a/js/components/whitelabel/prize/simple_prize/prize_app.js +++ b/js/components/whitelabel/prize/simple_prize/prize_app.js @@ -23,10 +23,7 @@ let PrizeApp = React.createClass({ render() { const { activeRoute, children, history, routes } = this.props; const subdomain = getSubdomain(); - - // The second element of routes is always the active component object, where we can - // extract the path. - const path = routes[1] ? routes[1].path : null; + const path = activeRoute && activeRoute.path; let header = null; // if the path of the current activeRoute is not defined, then this is the IndexRoute diff --git a/js/components/whitelabel/wallet/wallet_app.js b/js/components/whitelabel/wallet/wallet_app.js index 10ebd2b3..ec709ffc 100644 --- a/js/components/whitelabel/wallet/wallet_app.js +++ b/js/components/whitelabel/wallet/wallet_app.js @@ -21,10 +21,7 @@ let WalletApp = React.createClass({ render() { const { activeRoute, children, history, routes } = this.props; const subdomain = getSubdomain(); - - // The second element of routes is always the active component object, where we can - // extract the path. - const path = routes[1] ? routes[1].path : null; + const path = activeRoute && activeRoute.path; let header = null; // if the path of the current activeRoute is not defined, then this is the IndexRoute