13 lines
286 B
JavaScript
13 lines
286 B
JavaScript
import { useContext } from "react";
|
|
import { ThemeContext } from "./ThemeContextBase";
|
|
|
|
function useTheme() {
|
|
const context = useContext(ThemeContext);
|
|
if (!context) {
|
|
throw new Error("useTheme must be used within ThemeProvider.");
|
|
}
|
|
return context;
|
|
}
|
|
|
|
export { useTheme };
|