1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
|
"use client";
import { useEffect } from "react";
import { useTheme } from "@/hooks/useTheme";
export function ThemeInitializer() {
// Calling the hook applies the persisted theme and mode, and subscribes
// the document to system light/dark changes.
useTheme();
useEffect(() => {
document.documentElement.setAttribute("data-ready", "true");
}, []);
return null;
}
|