mirror of
https://github.com/Stone-Red-Code/website.git
synced 2026-09-04 09:15:58 +02:00
fix: undefined document in ssr
This commit is contained in:
committed by
Jean-Philippe Sirois
parent
b6b295fced
commit
c81d9246c4
@@ -26,9 +26,11 @@ const ThemeProvider: FC<IScopedDownChildren> = ({ children }) => {
|
||||
|
||||
// App's current theme
|
||||
const [theme, setTheme] = useState<ThemeType>(
|
||||
document.documentElement.style.getPropertyValue(
|
||||
"--initial-theme"
|
||||
) as ThemeType
|
||||
typeof document !== "undefined"
|
||||
? (document.documentElement.style.getPropertyValue(
|
||||
"--initial-theme"
|
||||
) as ThemeType)
|
||||
: "dark"
|
||||
)
|
||||
|
||||
const themeObject = useMemo(
|
||||
|
||||
Reference in New Issue
Block a user