MCPcopy Create free account
hub / github.com/TanStack/devtools / App

Function App

examples/solid/devtools-ui/src/index.tsx:23–60  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

21
22function App() {
23 const [theme, setTheme] = createSignal<TanStackDevtoolsTheme>(
24 darkThemeMq.matches ? 'dark' : 'light',
25 )
26
27 createEffect(theme, (value) => {
28 document.documentElement.setAttribute('data-theme', value)
29 })
30
31 const toggleTheme = () => {
32 setTheme((prev) => (prev === 'dark' ? 'light' : 'dark'))
33 }
34
35 return (
36 <div class="app-shell">
37 <button type="button" class="theme-toggle" onClick={toggleTheme}>
38 Toggle theme ({theme()})
39 </button>
40
41 <ThemeContextProvider theme={theme()}>
42 <h1>Json tree - dates</h1>
43
44 <div class="json-tree-container">
45 <JsonTree
46 value={JsonTreeDate}
47 config={{ dateFormat: 'DD-MM-YYYY' }}
48 />
49 </div>
50
51 <h1>Json tree - paths</h1>
52
53 <div class="json-tree-container">
54 <JsonTree value={JsonTreePath} collapsePaths={['foo']} />
55 </div>
56 </ThemeContextProvider>
57 </div>
58 )
59}
60
61const root = document.getElementById('root')
62if (root) render(() => <App />, root)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected