()
| 3 | import { ThemeContext } from '../ThemeProvider/ThemeProvider'; |
| 4 | |
| 5 | const useTheme = () => { |
| 6 | const context = useContext(ThemeContext); |
| 7 | |
| 8 | if (context === undefined) { |
| 9 | throw new Error('useTheme must be used within a ThemeProvider'); |
| 10 | } |
| 11 | |
| 12 | return context; |
| 13 | }; |
| 14 | |
| 15 | export default useTheme; |
no outgoing calls