Routing in React (09/16/2022)

PHOTO EMBED

Fri Sep 16 2022 05:17:28 GMT+0000 (UTC)

Saved by @Jeremicah #react.js

import { BrowserRouter, Routes, Route } from "react-router-dom";
import { Home, About, NotFound } from "./pages";
import Navbar from "./components/layout/Navbar";
import Footer from "./components/layout/Footer";

function App() {
return (
<BrowserRouter>
    <div className="flex flex-col justify-between h-screen">
        <Navbar />
        <main className="container mx-auto px-3 pb-12">
            <Routes>
                <Route path="/" element={<Home />} />
                <Route path="/about" element={<About />} />
                <Route path="/about" element={<NotFound />} />
                <Route path="/*" element={<NotFound />} />
            </Routes>
        </main>
        <Footer />
    </div>
</BrowserRouter>
);
}

export default App;
content_copyCOPY