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

Function renderTree

packages/devtools-ui/tests/tree.tsx:13–33  ·  view source on GitHub ↗
(
  value: any,
  extraProps: {
    defaultExpansionDepth?: number
    collapsePaths?: Array<TName>
    config?: { dateFormat?: string }
    copyable?: boolean
  } = {},
)

Source from the content-addressed store, hash-verified

11
12function renderTree<TData, TName extends CollapsiblePaths<TData>>(
13 value: any,
14 extraProps: {
15 defaultExpansionDepth?: number
16 collapsePaths?: Array<TName>
17 config?: { dateFormat?: string }
18 copyable?: boolean
19 theme?: 'light' | 'dark'
20 } = {},
21) {
22 const { theme = 'light', ...treeProps } = extraProps
23 container = document.createElement('div')
24 document.body.appendChild(container)
25 dispose = render(
26 () => (
27 <ThemeContextProvider theme={theme}>
28 <JsonTree value={value} {...treeProps} />
29 </ThemeContextProvider>
30 ),
31 container,
32 )
33 return container
34}
35
36afterEach(() => {

Callers 1

tree.tsxFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected