UNPKG

radix-ui-themes-with-tailwind

Version:
12 lines (8 loc) 298 B
import { useContext } from "react"; import { ThemeProviderContext } from "./ThemeProvider"; export const useTheme = () => { const context = useContext(ThemeProviderContext); if (context === undefined) throw new Error("useTheme must be used within a ThemeProvider"); return context; };