Skip to content

Commit

Permalink
Fix return value of useEffect
Browse files Browse the repository at this point in the history
  • Loading branch information
davidmz committed Dec 26, 2023
1 parent 36ed7b6 commit 248ce1b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/components/color-theme-setter.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,10 @@ import { darkTheme as selectDarkTheme } from './select-utils';
export function ColorSchemeSetter() {
const darkTheme = useSelector(selectDarkTheme);

useEffect(() => document.documentElement.classList.toggle('dark-theme', darkTheme), [darkTheme]);
useEffect(
() => void document.documentElement.classList.toggle('dark-theme', darkTheme),
[darkTheme],
);

return (
<Helmet defer={false}>
Expand Down

0 comments on commit 248ce1b

Please sign in to comment.