Skip to content

Instantly share code, notes, and snippets.

@astrotim
Created December 29, 2017 00:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save astrotim/12ca703033beaebaf2221bce83d5cc26 to your computer and use it in GitHub Desktop.
Save astrotim/12ca703033beaebaf2221bce83d5cc26 to your computer and use it in GitHub Desktop.
updated Post route in App.js
<h1 className="App-title">Welcome to React</h1>
- <Link to="/">Home</Link> <Link to="/post/">Post</Link>
</header>
<Switch>
<Route exact path="/" component={Home} />
- <Route path="/post/" component={Post} />
+ <Route path="/post/:id" component={Post} />
</Switch>
</div>
</BrowserRouter>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment