-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a75efda
commit cbe34c1
Showing
10 changed files
with
168 additions
and
23 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,22 @@ | ||
import './App.css'; | ||
|
||
import React from 'react'; | ||
import "./App.css"; | ||
import React from "react"; | ||
import { createBrowserRouter, RouterProvider } from "react-router-dom"; | ||
import ErrorPage from "./pages/ErrorPage"; | ||
import Homepage from "./pages/Homepage"; | ||
import Root from "./pages/Root"; | ||
const router = createBrowserRouter([ | ||
{ | ||
path: '/', | ||
element: <Root />, | ||
errorElement: <ErrorPage />, | ||
children: [ | ||
{ path: '/', element: <Homepage /> }, | ||
], | ||
} | ||
]); | ||
|
||
function App() { | ||
return ( | ||
<div className="App"> | ||
<header className="App-header"> | ||
<p> | ||
Hello | ||
</p> | ||
<a | ||
className="App-link" | ||
href="https://reactjs.org" | ||
target="_blank" | ||
rel="noopener noreferrer" | ||
> | ||
Learn React | ||
</a> | ||
</header> | ||
</div> | ||
); | ||
return <RouterProvider router={router} />; | ||
} | ||
|
||
export default App; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import React from "react"; | ||
|
||
function ErrorPage() { | ||
return ( | ||
<> | ||
<h1>404 Error Page</h1> | ||
</> | ||
); | ||
} | ||
export default ErrorPage; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import React from "react"; | ||
|
||
function Homepage() { | ||
return ( | ||
<> | ||
<h1>Homepage</h1> | ||
</> | ||
); | ||
} | ||
export default Homepage; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import React from 'react'; | ||
import { Outlet } from 'react-router-dom'; | ||
|
||
function Root() { | ||
return ( | ||
<> | ||
<main> | ||
<Outlet /> | ||
</main> | ||
</> | ||
); | ||
} | ||
|
||
export default Root; |