Skip to content

Commit 6f68601

Browse files
committed
Add not found boundaries
1 parent 24638c6 commit 6f68601

4 files changed

Lines changed: 74 additions & 0 deletions

File tree

src/app/NotFoundContent.tsx

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
/**
2+
* Copyright (c) Meta Platforms, Inc. and affiliates.
3+
*
4+
* This source code is licensed under the MIT license found in the
5+
* LICENSE file in the root directory of this source tree.
6+
*/
7+
8+
'use client';
9+
10+
import {MDXComponents} from 'components/MDX/MDXComponents';
11+
12+
const {Intro, MaxWidth, p: P, a: A} = MDXComponents;
13+
14+
export function NotFoundContent() {
15+
return (
16+
<main className="min-w-0 isolate">
17+
<article className="font-normal break-words text-primary dark:text-primary-dark">
18+
<div className="px-5 sm:px-12">
19+
<div className="max-w-7xl mx-auto">
20+
<MaxWidth>
21+
<Intro>
22+
<P>This page doesn’t exist.</P>
23+
<P>
24+
If this is a mistake{', '}
25+
<A href="https://github.com/reactjs/react.dev/issues/new">
26+
let us know
27+
</A>
28+
{', '}
29+
and we will try to fix it!
30+
</P>
31+
</Intro>
32+
</MaxWidth>
33+
</div>
34+
</div>
35+
</article>
36+
</main>
37+
);
38+
}

src/app/community/not-found.tsx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
/**
2+
* Copyright (c) Meta Platforms, Inc. and affiliates.
3+
*
4+
* This source code is licensed under the MIT license found in the
5+
* LICENSE file in the root directory of this source tree.
6+
*/
7+
8+
import {NotFoundContent} from '../NotFoundContent';
9+
10+
export default function NotFound() {
11+
return <NotFoundContent />;
12+
}

src/app/learn/not-found.tsx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
/**
2+
* Copyright (c) Meta Platforms, Inc. and affiliates.
3+
*
4+
* This source code is licensed under the MIT license found in the
5+
* LICENSE file in the root directory of this source tree.
6+
*/
7+
8+
import {NotFoundContent} from '../NotFoundContent';
9+
10+
export default function NotFound() {
11+
return <NotFoundContent />;
12+
}

src/app/reference/not-found.tsx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
/**
2+
* Copyright (c) Meta Platforms, Inc. and affiliates.
3+
*
4+
* This source code is licensed under the MIT license found in the
5+
* LICENSE file in the root directory of this source tree.
6+
*/
7+
8+
import {NotFoundContent} from '../NotFoundContent';
9+
10+
export default function NotFound() {
11+
return <NotFoundContent />;
12+
}

0 commit comments

Comments
 (0)