MCPcopy Create free account
hub / github.com/thetarnav/solid-devtools / ThemeProvider

Function ThemeProvider

examples/sandbox/src/Theme.tsx:32–46  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

30 color?: string
31 title?: string
32}> = props => {
33 const [theme, setTheme] = createStore({
34 color: props.color || defaultState.color,
35 title: props.title || defaultState.title,
36 })
37
38 const changeColor = (color: string) => setTheme('color', color)
39 const changeTitle = (title: string) => setTheme('title', title)
40
41 return (
42 <ThemeContext.Provider value={[theme, {changeColor, changeTitle}]}>
43 {props.children}
44 </ThemeContext.Provider>
45 )
46}
47
48export const useTheme = () => useContext(ThemeContext)
49

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…