MCPcopy Create free account
hub / github.com/szhsin/react-menu / useTheme

Function useTheme

example/src/store.js:12–18  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

10
11export const themeState = state('dark');
12export const useTheme = () => {
13 const theme = useSnapshot(themeState);
14 return {
15 isDark: theme === 'dark',
16 theme
17 };
18};
19themeState.subscribe(() => {
20 const theme = themeState.get();
21 document.body.className = bem('szh-app', null, { theme });

Callers 6

Example.jsFile · 0.90
Usage.jsFile · 0.90
Footer.jsFile · 0.90
ThemeSwitch.jsFile · 0.90
TableContents.jsFile · 0.90
Header.jsFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…