Spelunking-Studios / The-Caverns-Website

Found undefined as an Identifier JS-0127
Bug risk
Minor
2 occurrences in this check
Unexpected use of undefined
 1import { createContext, useContext, useState } from 'react';
 2
 3const ThemeContext = createContext(undefined); 4
 5function ThemeProvider({ children }) {
 6	const [theme, setTheme] = useState("light");
Unexpected use of undefined
 9
10function useTheme() {
11	const context = useContext(ThemeContext);
12	if (context === undefined) {13		throw new Error('useTheme must be used within a ThemeProvider');
14	}
15	return context;