11 lines
286 B
JavaScript
11 lines
286 B
JavaScript
import { useContext } from "react";
|
|
import { ThemeContext } from "../context/ThemeContext";
|
|
|
|
export const useTheme = () => {
|
|
const context = useContext(ThemeContext);
|
|
if (!context) {
|
|
throw new Error("useTheme debe usarse dentro de un <ThemeProvider>");
|
|
}
|
|
return context;
|
|
};
|