Skip to content

Commit fd62056

Browse files
Adds a catch-all route to handle 404 errors (#27)
1 parent b2ab075 commit fd62056

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

app/components/common/page-layout.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ import {
2020
import { Link, LinkProps, Route, Switch, useRoute } from 'wouter';
2121
import SmartLink from './smart-link';
2222
import Logo from './logo';
23+
import { RouteErrorHandler } from './error';
24+
import { NotFound } from './error/not-found';
2325
import { PageFooter } from './page-footer';
2426
import { AppContextProvider } from '$components/common/app-context';
2527
import { UserInfo } from '$components/auth/userInfo';
@@ -105,6 +107,12 @@ export default function PageLayout() {
105107
<Route path='/species/:id' component={Species} />
106108
<Route path='/individual/:id' component={IndividualSingle} />
107109
<Route path='/search' component={Search} />
110+
<Route
111+
path='*'
112+
component={() => (
113+
<RouteErrorHandler error={new NotFound('Page not found')} />
114+
)}
115+
/>
108116
</Switch>
109117
</Suspense>
110118
</Flex>

0 commit comments

Comments
 (0)