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

__root.tsx

53 lines1.2 KB

1import * as React from 'react'
2import { HeadContent, Scripts, createRootRoute } from '@tanstack/react-router'
3import { TanStackDevtools } from '@tanstack/react-devtools'
4import { EventProbePanel } from '@tanstack/devtools-e2e/event-probe'
5​
6export const Route = createRootRoute({
7 head: () => ({
8 meta: [
9 {
10 charSet: 'utf-8',
11 },
12 {
13 name: 'viewport',
14 content: 'width=device-width, initial-scale=1',
15 },
16 {
17 title: 'devtools e2e start',
18 },
19 ],
20 }),
21​
22 shellComponent: RootDocument,
23})
24​
25function RootDocument({ children }: { children: React.ReactNode }) {
26 return (
27 <html lang="en">
28 <head>
29 <HeadContent />
30 </head>
31 <body>
32 {children}
33 <TanStackDevtools
34 eventBusConfig={{ connectToServerBus: true }}
35 plugins={[
36 {
37 id: 'demo',
38 name: 'Demo',
39 defaultOpen: true,
40 render: <div data-testid="demo-plugin">demo plugin content</div>,
41 },
42 {
43 id: 'event-probe',
44 name: 'Event Probe',
45 render: <EventProbePanel />,
46 },
47 ]}
48 />
49 <Scripts />
50 </body>
51 </html>
52 )