From 00c9ae137676dc59c4191823260a5b92f31ce311 Mon Sep 17 00:00:00 2001 From: John Mitchell Date: Tue, 4 Dec 2018 11:33:04 -0500 Subject: [PATCH] update map function to be chained --- src/App.jsx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/App.jsx b/src/App.jsx index faaba35be8..8724016cce 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -57,11 +57,11 @@ const SideNavItems = ({ items, history }) => { const currentPath = history.location.pathname.replace(/^\//, ''); let activeGroup; if (currentPath !== '') { - const groupPaths = items.map(({ groupName, routes }) => ({ - groupName, - paths: routes.map(({ path }) => path) - })); - [{ groupName: activeGroup }] = groupPaths + [{ groupName: activeGroup }] = items + .map(({ groupName, routes }) => ({ + groupName, + paths: routes.map(({ path }) => path) + })) .filter(({ paths }) => paths.indexOf(currentPath) > -1); } else { activeGroup = 'views';