Hook to access the theme context.
Must be used within a ThemeProvider.
Throws
If used outside a ThemeProvider.
Source
exportconstuseTheme = (): ThemeContextType=> { constcontext = useContext(ThemeContext); if (context === undefined) { thrownewError("useTheme must be used within a ThemeProvider"); } returncontext; };
Hook to access the theme context. Must be used within a ThemeProvider.
Throws
If used outside a ThemeProvider.
Source