Created
March 31, 2021 17:54
-
-
Save bonnie/8cf7f235b630c8314f76f37167b76863 to your computer and use it in GitHub Desktop.
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
import { Switch, Route, Link } from "react-router-dom"; | |
import Home from "./Home"; | |
import Menus from "./Menus"; | |
import Locations from "./Locations"; | |
import About from "./About";export default function App() { | |
return ( | |
<div> | |
<nav> | |
<Link to="/">Our Restaurant</Link> | |
<Link to="/menus">Menus</Link> | |
<Link to="/locations">Locations</Link> | |
<Link to="/about">About</Link> | |
</nav> | |
{/* routing */} | |
<Switch> | |
<Route path="/menus" component={Menus} /> | |
<Route path="/locations/:id" component={Locations} /> | |
<Route path="/locations" component={Locations} /> | |
<Route path="/about" component={About} /> | |
<Route path="/" component={Home} /> | |
</Switch> | |
</div> | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment