MCPcopy Create free account
hub / github.com/TanStack/cli / toggleMode

Function toggleMode

examples/react/blog/src/components/ThemeToggle.tsx:57–63  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

55 }, [mode])
56
57 function toggleMode() {
58 const nextMode: ThemeMode =
59 mode === 'light' ? 'dark' : mode === 'dark' ? 'auto' : 'light'
60 setMode(nextMode)
61 applyThemeMode(nextMode)
62 window.localStorage.setItem('theme', nextMode)
63 }
64
65 const label =
66 mode === 'auto'

Callers

nothing calls this directly

Calls 1

applyThemeModeFunction · 0.85

Tested by

no test coverage detected