checkpoint: before i18n implementation
This commit is contained in:
@@ -1,13 +1,15 @@
|
||||
"use client"
|
||||
|
||||
import { useTheme } from "next-themes"
|
||||
import { useEffect, useState } from "react"
|
||||
import { useSyncExternalStore } from "react"
|
||||
|
||||
export default function ThemeToggle() {
|
||||
const { theme, setTheme } = useTheme()
|
||||
const [mounted, setMounted] = useState(false)
|
||||
|
||||
useEffect(() => setMounted(true), [])
|
||||
const mounted = useSyncExternalStore(
|
||||
() => () => {},
|
||||
() => true,
|
||||
() => false,
|
||||
)
|
||||
|
||||
if (!mounted) {
|
||||
return <button className="theme-toggle" aria-label="Toggle theme"><span style={{ width: 18, height: 18 }} /></button>
|
||||
|
||||
Reference in New Issue
Block a user