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

basic-setup.md

69 lines1.7 KB

1---
2title: Basic setup
3id: basic-setup
4---
5​
6TanStack devtools provides you with an easy to use and modular client that allows you to compose multiple devtools into one easy to use panel.
7​
8## Setup
9​
10Install the [TanStack Devtools](https://www.npmjs.com/package/@tanstack/preact-devtools) library, this will install the devtools core as well as provide you framework specific adapters.
11​
12```bash
13npm i @tanstack/preact-devtools
14```
15​
16Next in the root of your application import the `TanStackDevtools` from the required framework adapter (in this case @tanstack/preact-devtools).
17​
18```tsx
19import { TanStackDevtools } from '@tanstack/preact-devtools'
20import { render } from 'preact'
21​
22import App from './App'
23​
24render(
25 <>
26 <App />
27​
28 <TanStackDevtools />
29 </>,
30 document.getElementById('root')!,
32```
33​
34Import the desired devtools and provide it to the `TanStackDevtools` component along with a label for the menu.
35​
36Currently TanStack offers:
37​
38- `QueryDevtools`
39- `RouterDevtools`
40- `PacerDevtools`
41- `FormDevtools` [coming soon](https://github.com/TanStack/form/pull/1692)
42​
43```tsx
44import { render } from 'preact'
45​
46import { TanStackDevtools } from '@tanstack/preact-devtools'
47​
48import App from './App'
49​
50render(
51 <>
52 <App />
53​
54 <TanStackDevtools
55 plugins={[
56 {
57 name: 'Your Plugin',
58 render: <YourPluginComponent />,
59 },
60 ]}
61 />
62 </>,
63 document.getElementById('root')!,
65```
66​
67Finally add any additional configuration you desire to the `TanStackDevtools` component, more information can be found under the [TanStack Devtools Configuration](../../configuration) section.
68​
69A complete working example can be found in our [basic example](https://tanstack.com/devtools/latest/docs/framework/preact/examples/basic).