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");