mirror of
https://github.com/10h30/astroplate.git
synced 2026-07-18 06:03:27 +09:00
initialize project
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
import { useEffect, useState } from 'react';
|
||||
|
||||
const useTheme = (): string => {
|
||||
const [themeValue, setThemeValue] = useState("");
|
||||
|
||||
useEffect(() => {
|
||||
setThemeValue(document.documentElement.classList.contains('dark')? 'dark' : 'light');
|
||||
}, []);
|
||||
|
||||
return themeValue;
|
||||
};
|
||||
|
||||
export default useTheme;
|
||||
Reference in New Issue
Block a user