diff --git a/src/app.tsx b/src/app.tsx
index cdcac73..03fabaf 100644
--- a/src/app.tsx
+++ b/src/app.tsx
@@ -5,8 +5,8 @@ import LoginPage from "./pages/login";
import { AppProvider } from "./providers/AuthProvider";
const HomePage: FunctionComponent = () => {
- const location = useLocation();
- location.route("/login");
+ const { route } = useLocation();
+ route("/login");
return
Redirecting to login...
;
};
diff --git a/src/components/menu.tsx b/src/components/menu.tsx
index 87406bd..6ca4232 100644
--- a/src/components/menu.tsx
+++ b/src/components/menu.tsx
@@ -9,8 +9,8 @@ interface MenuItemProps {
}
const MenuItem: FunctionComponent = ({ title, link }: MenuItemProps) => {
- const location = useLocation();
- const active = location.path === link;
+ const { route, path } = useLocation();
+ const active = path === link;
const menuItemClasses = tv({
base: classes.menu_item,
variants: {
@@ -24,7 +24,7 @@ const MenuItem: FunctionComponent = ({ title, link }: MenuItemPro
},
});
return (
-