1
0
Fork 0
mirror of https://github.com/kou029w/_.git synced 2025-02-07 09:38:46 +00:00

静的ページに対応

This commit is contained in:
Nebel 2019-04-25 10:27:05 +09:00
parent c8c3ec30dc
commit 2587ffba66

View file

@ -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 (
<div className={classes.root}>