Created
December 29, 2017 00:39
Revisions
-
Tim Holt revised this gist
Dec 29, 2017 . 1 changed file with 1 addition and 8 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,10 +1,3 @@ <h1 className="App-title">Welcome to React</h1> - <Link to="/">Home</Link> <Link to="/post/">Post</Link> </header> @@ -14,4 +7,4 @@ index f7d722b..93cfd00 100644 + <Route path="/post/:id" component={Post} /> </Switch> </div> </BrowserRouter> -
Tim Holt created this gist
Dec 29, 2017 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,17 @@ diff --git a/src/App.js b/src/App.js index f7d722b..93cfd00 100644 --- a/src/App.js +++ b/src/App.js @@ -15,11 +15,10 @@ class App extends Component { <img src={logo} className="App-logo" alt="logo" /> </Link> <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>