Skip to content

Commit 04a8f91

Browse files
committed
docs(react): basic setup
1 parent 38e1cb4 commit 04a8f91

File tree

2 files changed

+70
-4
lines changed

2 files changed

+70
-4
lines changed

docs/framework/react/basic-setup.md

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
---
2+
title: Basic setup
3+
id: basic-setup
4+
---
5+
6+
TanStack 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+
10+
Install the [TanStack Devtools](https://tanstack.com/devtools/) library, this will install the devtools core as well as provide you framework specific adapters.
11+
12+
```bash
13+
npm i @tanstack/devtools
14+
```
15+
16+
Next in the root of your application import the `TanstackDevtools` from the required framework adapter (in this case @tanstack/react-devtools).
17+
18+
```tsx
19+
import { TanstackDevtools } from '@tanstack/react-devtools'
20+
21+
import App from './App'
22+
23+
createRoot(document.getElementById('root')!).render(
24+
<StrictMode>
25+
<App />
26+
27+
<TanstackDevtools />
28+
</StrictMode>,
29+
)
30+
```
31+
32+
Import the desired devtools and provide it to the `TanstackDevtools` component along with a label for the menu.
33+
34+
Currently TanStack offers:
35+
36+
- `QueryDevtools`
37+
- `RouterDevtools`
38+
- `FormDevtools`
39+
40+
```tsx
41+
import { TanstackDevtools } from '@tanstack/react-devtools'
42+
43+
import { QueryDevtools } from '@tanstack/react-query'
44+
import { FormDevtools } from '@tanstack/react-form'
45+
46+
import App from './App'
47+
48+
createRoot(document.getElementById('root')!).render(
49+
<StrictMode>
50+
<App />
51+
52+
<TanstackDevtools
53+
plugins={[
54+
{
55+
name: 'Tanstack Query',
56+
render: <QueryDevtools />,
57+
},
58+
{
59+
name: 'Tanstack Form',
60+
render: <FormDevtools />,
61+
},
62+
]}
63+
/>
64+
</StrictMode>,
65+
)
66+
```
67+
68+
Finally add any additional configuration you desire to the `TanstackDevtools` component, more information can be found under the [TanStack Devtools Configuration](https://tanstack.com/devtools/) section.
69+
70+
A complete working example can be found in our [examples section](https://tanstack.com/devtools/latest/docs/framework/react/examples).

docs/guides/example-guide.md

Lines changed: 0 additions & 4 deletions
This file was deleted.

0 commit comments

Comments
 (0)