From 2587ffba669bc4ad859b3cc5763c83339856ad5e Mon Sep 17 00:00:00 2001 From: Kohei Watanabe Date: Thu, 25 Apr 2019 10:27:05 +0900 Subject: [PATCH] =?UTF-8?q?=E9=9D=99=E7=9A=84=E3=83=9A=E3=83=BC=E3=82=B8?= =?UTF-8?q?=E3=81=AB=E5=AF=BE=E5=BF=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- styles/TopAppBar.tsx | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/styles/TopAppBar.tsx b/styles/TopAppBar.tsx index 4775268..ab824fa 100644 --- a/styles/TopAppBar.tsx +++ b/styles/TopAppBar.tsx @@ -14,7 +14,11 @@ const TopAppBar: React.FC<{ router: any }> = ({ router }) => { routes.findIndex(({ pathname }) => pathname === router.pathname) ); router.events.on("routeChangeStart", (url: string) => { - setValue(routes.findIndex(({ pathname }) => pathname === url)); + setValue( + routes.findIndex( + ({ pathname }) => pathname === url.replace(/(?<=.)\/$/, "") + ) + ); }); return (