File tree Expand file tree Collapse file tree 4 files changed +35
-14
lines changed Expand file tree Collapse file tree 4 files changed +35
-14
lines changed Original file line number Diff line number Diff line change 1
1
import { createRoot } from 'react-dom/client'
2
2
import Devtools from './setup'
3
3
import { queryPlugin } from './plugin'
4
+
4
5
setTimeout ( ( ) => {
5
6
queryPlugin . emit ( 'test' , {
6
7
title : 'Test Event' ,
@@ -12,10 +13,11 @@ setTimeout(() => {
12
13
queryPlugin . on ( 'test' , ( event ) => {
13
14
console . log ( 'Received test event:' , event )
14
15
} )
16
+
15
17
function App ( ) {
16
18
return (
17
19
< div >
18
- < h1 > TanStack Devtools Basic Example</ h1 >
20
+ < h1 > TanStack Devtools React Basic Example</ h1 >
19
21
< Devtools />
20
22
</ div >
21
23
)
Original file line number Diff line number Diff line change @@ -2,13 +2,13 @@ import { QueryClient, QueryClientProvider } from '@tanstack/react-query'
2
2
import { ReactQueryDevtoolsPanel } from '@tanstack/react-query-devtools'
3
3
import { TanStackRouterDevtoolsPanel } from '@tanstack/react-router-devtools'
4
4
import {
5
- Outlet ,
6
5
Link ,
7
- createRouter ,
8
- createRoute ,
6
+ Outlet ,
7
+ RouterProvider ,
9
8
createRootRoute ,
9
+ createRoute ,
10
+ createRouter ,
10
11
} from '@tanstack/react-router'
11
- import { TanStackRouterDevtools } from '@tanstack/react-router-devtools'
12
12
import { TanstackDevtools } from '@tanstack/react-devtools'
13
13
14
14
const rootRoute = createRootRoute ( {
@@ -24,7 +24,6 @@ const rootRoute = createRootRoute({
24
24
</ div >
25
25
< hr />
26
26
< Outlet />
27
- < TanStackRouterDevtools />
28
27
</ >
29
28
) ,
30
29
} )
@@ -41,7 +40,11 @@ const indexRoute = createRoute({
41
40
} ,
42
41
} )
43
42
function About ( ) {
44
- return < div className = "p-2" > Hello from About!</ div >
43
+ return (
44
+ < div className = "p-2" >
45
+ < h3 > Hello from About!</ h3 >
46
+ </ div >
47
+ )
45
48
}
46
49
47
50
const aboutRoute = createRoute ( {
@@ -72,6 +75,7 @@ export default function DevtoolsExample() {
72
75
} ,
73
76
] }
74
77
/>
78
+ < RouterProvider router = { router } />
75
79
</ QueryClientProvider >
76
80
</ >
77
81
)
Original file line number Diff line number Diff line change 1
1
import { render } from 'solid-js/web'
2
2
import Devtools from './setup'
3
+
3
4
function App ( ) {
4
5
return (
5
6
< div >
6
- < h1 > TanStack Devtools Basic Example</ h1 >
7
+ < h1 > TanStack Devtools Solid Basic Example</ h1 >
7
8
< Devtools />
8
9
</ div >
9
10
)
Original file line number Diff line number Diff line change @@ -2,20 +2,28 @@ import { QueryClient, QueryClientProvider } from '@tanstack/solid-query'
2
2
import { SolidQueryDevtools } from '@tanstack/solid-query-devtools'
3
3
import { TanStackRouterDevtoolsPanel } from '@tanstack/solid-router-devtools'
4
4
import {
5
+ Link ,
5
6
Outlet ,
6
- createRouter ,
7
- createRoute ,
7
+ RouterProvider ,
8
8
createRootRoute ,
9
+ createRoute ,
10
+ createRouter ,
9
11
} from '@tanstack/solid-router'
10
- import { TanStackRouterDevtools } from '@tanstack/solid-router-devtools'
11
12
import { TanstackDevtools } from '@tanstack/solid-devtools'
13
+
12
14
const rootRoute = createRootRoute ( {
13
15
component : ( ) => (
14
16
< >
15
- < div class = "p-2 flex gap-2" > </ div >
17
+ < div class = "p-2 flex gap-2" >
18
+ < Link to = "/" class = "[&.active]:font-bold" >
19
+ Home
20
+ </ Link > { ' ' }
21
+ < Link to = "/about" class = "[&.active]:font-bold" >
22
+ About
23
+ </ Link >
24
+ </ div >
16
25
< hr />
17
26
< Outlet />
18
- < TanStackRouterDevtools />
19
27
</ >
20
28
) ,
21
29
} )
@@ -32,8 +40,13 @@ const indexRoute = createRoute({
32
40
} ,
33
41
} )
34
42
function About ( ) {
35
- return < div class = "p-2" > Hello from About!</ div >
43
+ return (
44
+ < div class = "p-2" >
45
+ < h3 > Hello from About!</ h3 >
46
+ </ div >
47
+ )
36
48
}
49
+
37
50
const aboutRoute = createRoute ( {
38
51
getParentRoute : ( ) => rootRoute ,
39
52
path : '/about' ,
@@ -65,6 +78,7 @@ export default function DevtoolsExample() {
65
78
} ,
66
79
] }
67
80
/>
81
+ < RouterProvider router = { router } />
68
82
</ >
69
83
)
70
84
}
You can’t perform that action at this time.
0 commit comments