39 lines
790 B
React
39 lines
790 B
React
|
import { RouterProvider, createBrowserRouter } from "react-router-dom";
|
||
|
import "./App.css";
|
||
|
import Home from "./pages/Home";
|
||
|
import About from "./pages/About";
|
||
|
import Contact from "./pages/Contact";
|
||
|
import Layout from "./components/layout/Layout";
|
||
|
import Error from "./components/Error";
|
||
|
function App() {
|
||
|
const router = createBrowserRouter([
|
||
|
{
|
||
|
path: "/",
|
||
|
element: <Layout />,
|
||
|
errorElement: <Error />,
|
||
|
children: [
|
||
|
{
|
||
|
path: "/about",
|
||
|
element: <About />,
|
||
|
},
|
||
|
{
|
||
|
path: "/contact",
|
||
|
element: <Contact />,
|
||
|
},
|
||
|
{
|
||
|
path: "/",
|
||
|
element: <Home />,
|
||
|
},
|
||
|
],
|
||
|
},
|
||
|
]);
|
||
|
|
||
|
return (
|
||
|
<>
|
||
|
<RouterProvider router={router} />
|
||
|
</>
|
||
|
);
|
||
|
}
|
||
|
|
||
|
export default App;
|