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

basic-setup.md

73 lines2.0 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/solid-devtools) library, this will install the devtools core as well as provide you framework specific adapters.
11​
12```bash
13npm i @tanstack/solid-devtools
14```
15​
16Next in the root of your application import the `TanStackDevtools` from the required framework adapter (in this case @tanstack/solid-devtools).
17​
18```tsx
19import { TanStackDevtools } from '@tanstack/solid-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- `FormDevtools`
39​
40```tsx
41import { render } from 'solid-js/web';
42​
43import { TanStackDevtools } from '@tanstack/solid-devtools'
44​
45import { SolidQueryDevtoolsPanel } from '@tanstack/solid-query-devtools'
46import { TanStackRouterDevtoolsPanel } from '@tanstack/solid-router-devtools'
47import { SolidFormDevtoolsPanel } from '@tanstack/solid-form'
48​
49import App from './App'
50​
51render(() => (
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​
71Finally add any additional configuration you desire to the `TanStackDevtools` component, more information can be found under the [TanStack Devtools Configuration](../../configuration) section.
72​
73A complete working example can be found in our [examples section](https://tanstack.com/devtools/latest/docs/framework/solid/examples).