useTheme
Read and set the active theme.
useTheme reads and sets the active theme. It returns the stored choice, the
resolved theme, the OS preference, and a setter — everything you need to build a
theme switcher.
Usage
Guard theme-dependent UI with mounted so the first client render matches the
server output and you avoid a hydration mismatch:
Return value
Requires a ThemeProvider ancestor. Without one, the hook returns inert values
(mounted stays false) rather than throwing.