Chap05 -> Handling routes not found
This commit is contained in:
parent
70839dfeca
commit
076120fee7
@ -9,6 +9,7 @@ import { fontFamily, fontSize, gray2 } from './Styles';
|
|||||||
import { AskPage } from './AskPage';
|
import { AskPage } from './AskPage';
|
||||||
import { SearchPage } from './SearchPage';
|
import { SearchPage } from './SearchPage';
|
||||||
import { SignInPage } from './SignInPage';
|
import { SignInPage } from './SignInPage';
|
||||||
|
import { NotFoundPage } from './NotFoundPage';
|
||||||
|
|
||||||
function App() {
|
function App() {
|
||||||
return (
|
return (
|
||||||
@ -25,6 +26,7 @@ function App() {
|
|||||||
<Route path="search" element={<SearchPage />} />
|
<Route path="search" element={<SearchPage />} />
|
||||||
<Route path="ask" element={<AskPage />} />
|
<Route path="ask" element={<AskPage />} />
|
||||||
<Route path="signin" element={<SignInPage />} />
|
<Route path="signin" element={<SignInPage />} />
|
||||||
|
<Route path="*" element={<NotFoundPage />} />
|
||||||
</Routes>
|
</Routes>
|
||||||
</div>
|
</div>
|
||||||
</BrowserRouter>
|
</BrowserRouter>
|
||||||
|
4
QandA/frontend/src/NotFoundPage.tsx
Normal file
4
QandA/frontend/src/NotFoundPage.tsx
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
import React from 'react';
|
||||||
|
import { Page } from './Page';
|
||||||
|
|
||||||
|
export const NotFoundPage = () => <Page title="Page Not Found">{null}</Page>;
|
Loading…
x
Reference in New Issue
Block a user