fix: respect color scheme in SSR

This commit is contained in:
Felix Schröter 2022-11-15 23:17:34 +01:00
parent a27ff3acca
commit 58a48098e9
Signed by: felschr
GPG key ID: 671E39E6744C807D

7
gatsby-ssr.ts Normal file
View file

@ -0,0 +1,7 @@
import React from "react"
import { GatsbySSR } from "gatsby"
import { getInitColorSchemeScript } from "@mui/material"
export const onRenderBody: GatsbySSR["onRenderBody"] = ({ setPreBodyComponents }) => {
setPreBodyComponents([getInitColorSchemeScript()])
}