Created
September 28, 2021 16:26
-
-
Save burkeholland/1b9aed83b0a7a618f0eaf70ad2774380 to your computer and use it in GitHub Desktop.
Router Example
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
<Router> | |
<div className="main"> | |
<Nav user={user} /> | |
<div className="container"> | |
<Switch> | |
<Route path="/" exact> | |
<Home /> | |
</Route> | |
<Route path="/edit/:id?"> | |
<Edit /> | |
</Route> | |
<Route path="/admin"> | |
<Admin /> | |
</Route> | |
<Route path="/post/:id" children={<Post user={user} />} /> | |
</Switch> | |
</div> | |
</div> | |
</Router> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment