From 714f1d1a926b68b8d7cd470c43f26652d6b1d6bd Mon Sep 17 00:00:00 2001 From: mbaharip <62494292+mbahArip@users.noreply.github.com> Date: Sun, 7 May 2023 18:35:34 +0700 Subject: [PATCH] Remove useTransition --- src/components/layout/Navbar/index.tsx | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/components/layout/Navbar/index.tsx b/src/components/layout/Navbar/index.tsx index 015d431..de4ced1 100644 --- a/src/components/layout/Navbar/index.tsx +++ b/src/components/layout/Navbar/index.tsx @@ -36,7 +36,6 @@ type Props = { }; export default function Navbar({ isUnlocked, setIsUnlocked }: Props) { const { theme, setTheme } = useContext(ThemeContext); - const [_, startTransition] = useTransition(); const [isMenuOpen, setIsMenuOpen] = useState(false); const [isLogoutOpen, setIsLogoutOpen] = useState(false); @@ -348,10 +347,8 @@ export default function Navbar({ isUnlocked, setIsUnlocked }: Props) { onClick={() => { if (typeof window !== "undefined") { window.localStorage.removeItem("sitePassword"); - startTransition(() => { - setIsLogoutOpen(false); - setIsUnlocked(false); - }); + setIsLogoutOpen(false); + setIsUnlocked(false); } }} className={"primary flex-grow"}