Skip to content

Commit 8752b6d

Browse files
authored
Merge pull request #13 from harry-whorlow/docs-basic-setup
docs(react): basic setup
2 parents 38e1cb4 + 22631ae commit 8752b6d

File tree

5 files changed

+166
-11
lines changed

5 files changed

+166
-11
lines changed

docs/framework/react/basic-setup.md

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
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://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
13+
npm i @tanstack/react-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 { createRoot } from 'react-dom/client'
42+
43+
import { TanstackDevtools } from '@tanstack/react-devtools'
44+
45+
import { ReactQueryDevtoolsPanel } from '@tanstack/react-query-devtools'
46+
import { TanStackRouterDevtoolsPanel } from '@tanstack/react-router-devtools'
47+
import { ReactFormDevtoolsPanel } from '@tanstack/react-form'
48+
49+
50+
import App from './App'
51+
52+
createRoot(document.getElementById('root')!).render(
53+
<StrictMode>
54+
<App />
55+
56+
<TanstackDevtools
57+
plugins={[
58+
{
59+
name: 'Tanstack Query',
60+
render: <ReactQueryDevtoolsPanel />,
61+
},
62+
{
63+
name: 'Tanstack Router',
64+
render: <TanStackRouterDevtoolsPanel />,
65+
},
66+
{
67+
name: 'Tanstack Form',
68+
render: <ReactFormDevtoolsPanel />,
69+
},
70+
]}
71+
/>
72+
</StrictMode>,
73+
)
74+
```
75+
76+
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.
77+
78+
A complete working example can be found in our [examples section](https://tanstack.com/devtools/latest/docs/framework/react/examples).

docs/framework/solid/basic-setup.md

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
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://www.npmjs.com/package/@tanstack/solid-devtools) library, this will install the devtools core as well as provide you framework specific adapters.
11+
12+
```bash
13+
npm i @tanstack/solid-devtools
14+
```
15+
16+
Next in the root of your application import the `TanstackDevtools` from the required framework adapter (in this case @tanstack/solid-devtools).
17+
18+
```tsx
19+
import { TanstackDevtools } from '@tanstack/solid-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 { render } from 'solid-js/web';
42+
43+
import { TanstackDevtools } from '@tanstack/solid-devtools'
44+
45+
import { SolidQueryDevtoolsPanel } from '@tanstack/solid-query-devtools'
46+
import { TanStackRouterDevtoolsPanel } from '@tanstack/solid-router-devtools'
47+
import { SolidFormDevtoolsPanel } from '@tanstack/solid-form'
48+
49+
import App from './App'
50+
51+
render(() => (
52+
<>
53+
<App />
54+
55+
<TanstackDevtools
56+
plugins={[
57+
{
58+
name: 'Tanstack router',
59+
render: () => <TanStackRouterDevtoolsPanel />,
60+
},
61+
{
62+
name: 'Tanstack Form',
63+
render: () => <SolidFormDevtoolsPanel />,
64+
},
65+
]}
66+
/>
67+
</>
68+
), document.getElementById('root')!);
69+
```
70+
71+
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.
72+
73+
A complete working example can be found in our [examples section](https://tanstack.com/devtools/latest/docs/framework/solid/examples).
Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,16 @@
11
---
22
title: TanStack Devtools Solid Adapter
3-
ref: docs/framework/react/adapter.md
4-
replace: {
5-
"React": "Solid",
6-
"react": "solid"
7-
}
3+
ref: adapter
84
---
5+
6+
If you are using TanStack Devtools in a Solid application, we recommend using the Solid Adapter. The Solid Adapter provides a set of easy-to-use hooks on top of the core Devtools utilities. If you find yourself wanting to use the core Devtools classes/functions directly, the Solid Adapter will also re-export everything from the core package.
7+
8+
## Installation
9+
10+
```sh
11+
npm install @tanstack/solid-devtools
12+
```
13+
14+
## Solid Hooks
15+
16+
TODO

docs/guides/example-guide.md

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

examples/react/basic/src/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import ReactDOM from 'react-dom/client'
1+
import { createRoot } from 'react-dom/client'
22
import Devtools from './setup'
33
import { queryPlugin } from './plugin'
44
setTimeout(() => {
@@ -21,5 +21,5 @@ function App() {
2121
)
2222
}
2323

24-
const root = ReactDOM.createRoot(document.getElementById('root')!)
24+
const root = createRoot(document.getElementById('root')!)
2525
root.render(<App />)

0 commit comments

Comments
 (0)