From f8a3ad3760e6d33007c00d8df476ef415d0bf678 Mon Sep 17 00:00:00 2001 From: Timo <16718859+toger5@users.noreply.github.com> Date: Thu, 22 Feb 2024 09:29:11 +0100 Subject: [PATCH] Update src/App.tsx Co-authored-by: Robin --- src/App.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/App.tsx b/src/App.tsx index eba869f8..51dc38d0 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -69,7 +69,7 @@ const ThemeProvider: FC = ({ children }) => { const [previousTheme, setCurrentTheme] = useState( document.body.classList.item(0), ); - useEffect(() => { + useLayoutEffect(() => { // Don't update the current theme if the url does not contain a theme prop. if (!theme) return; const themeString = "cpd-theme-" + (theme ?? "dark");