Fix theme not switching
This commit is contained in:
parent
2f1221a568
commit
fbb0701b51
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@hibas123/theme-preact",
|
"name": "@hibas123/theme-preact",
|
||||||
"version": "1.0.8",
|
"version": "1.0.9",
|
||||||
"description": "",
|
"description": "",
|
||||||
"main": "out/index.js",
|
"main": "out/index.js",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
@ -47,6 +47,8 @@ export default function Theme({ mode, children, ...colors }: IThemeProps) {
|
|||||||
setIsDark(modeMediaQuery.matches);
|
setIsDark(modeMediaQuery.matches);
|
||||||
|
|
||||||
return modeMediaQuery.removeListener(listener);
|
return modeMediaQuery.removeListener(listener);
|
||||||
|
} else {
|
||||||
|
setIsDark(mode === ThemeModes.DARK);
|
||||||
}
|
}
|
||||||
}, [mode]);
|
}, [mode]);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user