forked from QwikDev/devtools
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathroot.tsx
More file actions
36 lines (35 loc) · 975 Bytes
/
root.tsx
File metadata and controls
36 lines (35 loc) · 975 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import { component$ } from '@qwik.dev/core';
import { isDev } from '@qwik.dev/core/build';
import {
QwikRouterProvider,
RouterOutlet,
ServiceWorkerRegister,
} from '@qwik.dev/router';
import { RouterHead } from './components/router-head/router-head';
import './global.css';
export default component$(() => {
/**
* The root of a QwikRouter site always start with the <QwikRouterProvider> component,
* immediately followed by the document's <head> and <body>.
*
* Don't remove the `<head>` and `<body>` elements.
*/
return (
<QwikRouterProvider viewTransition={true}>
<head>
<meta charset="utf-8" />
{!isDev && (
<link
rel="manifest"
href={`${import.meta.env.BASE_URL}manifest.json`}
/>
)}
<RouterHead />
</head>
<body lang="en">
<RouterOutlet />
{!isDev && <ServiceWorkerRegister />}
</body>
</QwikRouterProvider>
);
});