MCPcopy Create free account
hub / github.com/TanStack/query / renderExplorer

Function renderExplorer

packages/query-devtools/src/__tests__/Explorer.test.tsx:23–53  ·  view source on GitHub ↗
(
    props: Parameters<typeof SearchableExplorer>[0],
    options: {
      theme?: 'dark' | 'light'
      searchable?: boolean
      container?: HTMLElement
    } = {},
  )

Source from the content-addressed store, hash-verified

21 })
22
23 function renderExplorer(
24 props: Parameters<typeof SearchableExplorer>[0],
25 options: {
26 theme?: 'dark' | 'light'
27 searchable?: boolean
28 container?: HTMLElement
29 } = {},
30 ) {
31 const theme = options.theme ?? 'dark'
32 return render(
33 () => (
34 <QueryDevtoolsContext.Provider
35 value={{
36 client: queryClient,
37 queryFlavor: 'TanStack Query',
38 version: '5',
39 onlineManager,
40 }}
41 >
42 <ThemeContext.Provider value={() => theme}>
43 {options.searchable ? (
44 <SearchableExplorer {...props} />
45 ) : (
46 <Explorer {...props} />
47 )}
48 </ThemeContext.Provider>
49 </QueryDevtoolsContext.Provider>
50 ),
51 { container: options.container },
52 )
53 }
54
55 function renderSearchable(props: Parameters<typeof SearchableExplorer>[0]) {
56 return renderExplorer(props, { searchable: true })

Callers 2

renderSearchableFunction · 0.85
Explorer.test.tsxFile · 0.85

Calls 1

renderFunction · 0.50

Tested by

no test coverage detected