Skip to content

Commit d3f0bc5

Browse files
committed
Update Introduction.md
1 parent 33696d2 commit d3f0bc5

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

docs/Introduction.md

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,15 +189,18 @@ render((
189189
<Route path="/" component={App}>
190190
<Route path="about" component={About} />
191191
<Route path="inbox" component={Inbox}>
192-
{/* Add the route, nested where we want the UI to nest */}
192+
{/* add some nested routes where we want the UI to nest */}
193+
{/* render the stats page when at `/inbox` */}
194+
<IndexRoute component={InboxStats}/>
195+
{/* render the message component at /inbox/messages/123 */}
193196
<Route path="messages/:id" component={Message} />
194197
</Route>
195198
</Route>
196199
</Router>
197200
), document.body)
198201
```
199202

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

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

213+
And visits to `/inbox` will build this:
214+
215+
```
216+
<App>
217+
<Inbox>
218+
<InboxStats />
219+
</Inbox>
220+
</App>
221+
```
222+
223+
210224
### Getting URL Parameters
211225

212226
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`.

0 commit comments

Comments
 (0)