Skip to content
Source
Sign inSign up
TanStack/devtools
Open History to see the last commit

README.md

57 lines1.4 KB

1# @tanstack/preact-devtools
2​
3This package is still under active development and might have breaking changes in the future. Please use it with caution.
4​
5## Usage
6​
7```tsx
8import { TanStackDevtools } from '@tanstack/preact-devtools'
9import { PreactQueryDevtoolsPanel } from '@tanstack/preact-query-devtools'
10import { TanStackRouterDevtoolsPanel } from '@tanstack/preact-router-devtools'
11import { QueryClient, QueryClientProvider } from '@tanstack/preact-query'
12const queryClient = new QueryClient()
13function App() {
14 return (
15 <QueryClientProvider client={queryClient}>
16 <h1>My App</h1>
17 <TanStackDevtools
18 plugins={[
19 {
20 name: 'TanStack Query',
21 render: <PreactQueryDevtoolsPanel />,
22 },
23 {
24 name: 'TanStack Router',
25 render: <TanStackRouterDevtoolsPanel router={router} />,
26 },
27 ]}
28 />
29 </QueryClientProvider>
30 )
32```
33​
34## Creating plugins
35​
36In order to create a plugin for TanStack Devtools, you can use the `plugins` prop of the `TanStackDevtools` component. Here's an example of how to create a simple plugin:
37​
38```tsx
39import { TanStackDevtools } from '@tanstack/preact-devtools'
40​
41function App() {
42 return (
43 <div>
44 <h1>My App</h1>
45 <TanStackDevtools
46 plugins={[
47 {
48 id: 'your-plugin-id',
49 name: 'Your Plugin',
50 render: <CustomPluginComponent />,
51 },
52 ]}
53 />
54 </div>
55 )
57```