gompass/app/app.jsx

28 lines
964 B
JavaScript

import React from 'react';
import { BrowserRouter, Route, Routes } from 'react-router-dom';
/*some stylesheet is required to use react-bootstrip components*/
import 'bootstrap/dist/css/bootstrap.min.css';
import Contact from './pages/contact';
import Home from './pages/home';
import Map from './pages/map-page';
import NavBar from './components/nav-bar';
export default function App() {
return (
//BrowserRouter is the router implementation for HTML5 browsers
//Link enables Routes on an anchor tag
//Switch returns only the first matching route rather than all
//Route is the conditionally shown component //based on matching a path to a URL
<BrowserRouter>
<NavBar />
<Routes>
<Route path="/" element={<Map />} />
<Route path="/map" element={<Map />} />
<Route path="/contact" element={<Contact />} />
</Routes>
</BrowserRouter>
);
}