Fix theme not switching

This commit is contained in:
Fabian Stamm 2020-04-27 17:35:00 +02:00
parent 2f1221a568
commit fbb0701b51
2 changed files with 3 additions and 1 deletions

View File

@ -1,6 +1,6 @@
{
"name": "@hibas123/theme-preact",
"version": "1.0.8",
"version": "1.0.9",
"description": "",
"main": "out/index.js",
"dependencies": {

View File

@ -47,6 +47,8 @@ export default function Theme({ mode, children, ...colors }: IThemeProps) {
setIsDark(modeMediaQuery.matches);
return modeMediaQuery.removeListener(listener);
} else {
setIsDark(mode === ThemeModes.DARK);
}
}, [mode]);