message: chore: first pass to fix color-mode
diff: @@ -69,7 +69,12 @@ export const ColorModeProvider: React.FC = (props) => {
  }
  }, [colorMode, rawSetColorMode])
  - const mounted = React.useRef(false)
  + const [mounted, setMounted] = React.useState(false)
  + React.useEffect(() => {
  + setMounted(true)
  + }, [])
  +
  + const shouldRef = React.useRef(false)
  React.useEffect(() => {
  if (!window.hasOwnProperty("matchMedia")) return
  @@ -77,10 +82,10 @@ export const ColorModeProvider: React.FC = (props) => {
  const mq = window.matchMedia("(prefers-color-scheme: dark)")
  const listener = () => {
  - if (mounted.current) {
  + if (shouldRef.current) {
  ctx.setColorMode(!!mq.matches ? "dark" : "light")
  }
  - mounted.current = true
  + shouldRef.current = true
  }
  listener()
  @@ -92,7 +97,13 @@ export const ColorModeProvider: React.FC = (props) => {
  // eslint-disable-next-line react-hooks/exhaustive-deps
  }, [])
  - return <ColorModeContext.Provider value={ctx} children={children} />
  + return (
  + <ColorModeContext.Provider value={ctx}>
  + <div style={{ visibility: mounted ? "visible" : "hidden" }}>
  + {children}
  + </div>
  + </ColorModeContext.Provider>
  + )
  }
  if (__DEV__) {
  