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

basic-setup.md

79 lines2.2 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/react-devtools) library, this will install the devtools core as well as provide you framework specific adapters.
11​
12```bash
13npm i @tanstack/react-devtools
14```
15​
16Next in the root of your application import the `TanStackDevtools` from the required framework adapter (in this case @tanstack/react-devtools).
17​
18```tsx
19import { TanStackDevtools } from '@tanstack/react-devtools'
20​
21import App from './App'
22​
23createRoot(document.getElementById('root')!).render(
24 <StrictMode>
25 <App />
26​
27 <TanStackDevtools />
28 </StrictMode>,
30```
31​
32Import the desired devtools and provide it to the `TanStackDevtools` component along with a label for the menu.
33​
34Currently TanStack offers:
35​
36- `QueryDevtools`
37- `RouterDevtools`
38- `PacerDevtools`
39- `FormDevtools` [coming soon](https://github.com/TanStack/form/pull/1692)
40​
41```tsx
42import { createRoot } from 'react-dom/client'
43​
44import { TanStackDevtools } from '@tanstack/react-devtools'
45​
46import { ReactQueryDevtoolsPanel } from '@tanstack/react-query-devtools'
47import { TanStackRouterDevtoolsPanel } from '@tanstack/react-router-devtools'
48import { ReactFormDevtoolsPanel } from '@tanstack/react-form-devtools'
49​
50​
51import App from './App'
52​
53createRoot(document.getElementById('root')!).render(
54 <StrictMode>
55 <App />
56​
57 <TanStackDevtools
58 plugins={[
59 {
60 name: 'TanStack Query',
61 render: <ReactQueryDevtoolsPanel />,
62 },
63 {
64 name: 'TanStack Router',
65 render: <TanStackRouterDevtoolsPanel />,
66 },
67 {
68 name: 'TanStack Form',
69 render: <ReactFormDevtoolsPanel />,
70 },
71 ]}
72 />
73 </StrictMode>,
75```
76​
77Finally add any additional configuration you desire to the `TanStackDevtools` component, more information can be found under the [TanStack Devtools Configuration](../../configuration) section.
78​
79A complete working example can be found in our [basic example](https://tanstack.com/devtools/latest/docs/framework/react/examples/basic).