assignment-4/src/App.jsx

39 lines
790 B
React
Raw Normal View History

2024-12-31 12:49:56 +00:00
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;