You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit b142389
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: README.md
+7-8Lines changed: 7 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,13 +3,14 @@
3
3
Topics:
4
4
5
5
* Single Page Applications
6
+
* React Router V4 (react-router-dom)
6
7
* Routing, declarative component based routing
7
-
* Browser vs Hash History
8
8
* Path and Component
9
9
10
10
## Project Description
11
11
12
12
* A starter pack project for all things React Router. Learn to set up a basic routing system within an application. Use this application to help guide your learning over the next couple of days.
13
+
***Note** that this project has already been boilerplated for you. There is no need to run any installation steps beyond `yarn install`.
13
14
14
15
### Initialize Project
15
16
@@ -19,10 +20,10 @@ Topics:
19
20
### Steps for implementing React Router
20
21
21
22
* You'll notice we've already installed react-router-dom for you.
22
-
*`import` your Router as BrowserRouter inside your `index.js` file.
23
+
*`import` your BrowserRouter as Router inside your `index.js` file.
23
24
* Wrap your `<App />` component that you're passing to `ReactDOM.render()` with your new `Router` component.
24
25
* open up your chrome `REACT DEV TOOLS` and notice your app is now all wrapped in `BrowserRouter`
25
-
* inside the `REACT DEV TOOLS` expand `<BrowserRouter>` and highlight `<Router>` and notice that here is a `"history"` object on props.
26
+
* inside the `REACT DEV TOOLS` expand `<BrowserRouter>` and highlight `<Router>` and notice that here is a `"history"` object on props and a `"match"` object on its state. These two objects are how all of our Router is going to work.
26
27
27
28
### Steps for "Declaring" your routes
28
29
@@ -34,11 +35,9 @@ Topics:
34
35
35
36
### Steps for setting up your Navigation
36
37
37
-
* Inside of `Navigation.js``import { Link } from 'react-router-dom'`
38
-
* Delete `NavLink` and replace it with `<Link />`
39
-
* Pro-tip: highlight NavLink and use `cmd/ctrl + d` to select them all at once.
40
-
* Change the href on `<Link>` to `to` and specify the correct routes to navigate to.
41
-
* Head over to your app and start navigating. You should be able to see your URLS changing their paths as you go.
38
+
* Inside of `Navigation.js``import { Link } from 'react-router-dom'`.
39
+
* Declare the `to` as the href on `<Link>` and specify the correct routes for your app to navigate towards.
40
+
* Head over to your app and start navigating. You should be able to see your URLS changing their paths as you go. Each path should display the proper component.
0 commit comments