Skip to content

Commit

Permalink
Update Introduction.md
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanflorence committed Nov 3, 2015
1 parent 33696d2 commit d3f0bc5
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions docs/Introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -189,15 +189,18 @@ render((
<Route path="/" component={App}>
<Route path="about" component={About} />
<Route path="inbox" component={Inbox}>
{/* Add the route, nested where we want the UI to nest */}
{/* add some nested routes where we want the UI to nest */}
{/* render the stats page when at `/inbox` */}
<IndexRoute component={InboxStats}/>
{/* render the message component at /inbox/messages/123 */}
<Route path="messages/:id" component={Message} />
</Route>
</Route>
</Router>
), document.body)
```

Now visits to URLs like `inbox/messages/Jkei3c32` will match the new route and build this:
Now visits to URLs like `inbox/messages/Jkei3c32` will match the new route and build this for you:

```
<App>
Expand All @@ -207,6 +210,17 @@ Now visits to URLs like `inbox/messages/Jkei3c32` will match the new route and b
</App>
```

And visits to `/inbox` will build this:

```
<App>
<Inbox>
<InboxStats />
</Inbox>
</App>
```


### Getting URL Parameters

We're going to need to know something about the message in order to fetch it from the server. Route components get some useful properties injected into them when you render, particularly the parameters from the dynamic segment of your path. In our case, `:id`.
Expand Down

0 comments on commit d3f0bc5

Please sign in to comment.