()
| 23 | }, []) |
| 24 | |
| 25 | const toggle = () => { |
| 26 | const next: Theme = theme === 'dark' ? 'light' : 'dark' |
| 27 | setTheme(next) |
| 28 | localStorage.setItem('theme', next) |
| 29 | document.documentElement.classList.toggle('dark', next === 'dark') |
| 30 | } |
| 31 | |
| 32 | // Prevent flash: hide until theme is known |
| 33 | if (!mounted) { |
nothing calls this directly
no outgoing calls
no test coverage detected