forked from clintonwoo/hackernews-remix-react
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathroot.tsx
54 lines (50 loc) · 1.15 KB
/
root.tsx
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
import {
ErrorBoundaryComponent,
Links,
LiveReload,
Meta,
Outlet,
Scripts,
ScrollRestoration,
} from 'remix';
import type { MetaFunction } from 'remix';
export const meta: MetaFunction = () => {
return { title: 'Hacker News Clone' };
};
export const ErrorBoundary: ErrorBoundaryComponent = (props) => {
const { error } = props;
return (
<html>
<head>
<title>Oh no!</title>
<Meta />
<Links />
</head>
<body>
<div>Something went wrong.</div>
{process.env.NODE_ENV === 'development' && <div>{error}</div>}
<Scripts />
</body>
</html>
);
};
export default function App() {
return (
<html lang="en">
<head>
<meta charSet="utf-8" />
<meta name="referrer" content="origin" />
<meta name="viewport" content="initial-scale=1.0, width=device-width" />
<link rel="shortcut icon" href="/static/favicon.ico" />
<Meta />
<Links />
</head>
<body>
<Outlet />
<ScrollRestoration />
<Scripts />
{process.env.NODE_ENV === 'development' && <LiveReload />}
</body>
</html>
);
}