Skip to content

Commit ca6d6cd

Browse files
committed
Introduction change to explain nesting using JSX.
1 parent f5aa145 commit ca6d6cd

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

docs/Introduction.md

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,9 @@ React.render((
141141
), document.body)
142142
```
143143

144-
React Router knows how to build nested UI for us, so we don't have to manually figure out which `<Child>` component to render. Internally, the router converts your `<Route>` element hierarchy to a [route config](/docs/Glossary.md#routeconfig). But if you're not digging the JSX you can use plain objects instead:
144+
React Router knows how to build nested UI for us, so we don't have to manually figure out which `<Child>` component to render. For example, for a full path `/about` it would build `<App><About /></App>`.
145+
146+
Internally, the router converts your `<Route>` element hierarchy to a [route config](/docs/Glossary.md#routeconfig). But if you're not digging the JSX you can use plain objects instead:
145147

146148
```js
147149
const routes = {
@@ -193,7 +195,15 @@ React.render((
193195
), document.body)
194196
```
195197

196-
Now visits to URLs like `inbox/messages/Jkei3c32` will match the new route and nest the UI branch of `App -> Inbox -> Message`.
198+
Now visits to URLs like `inbox/messages/Jkei3c32` will match the new route and build this:
199+
200+
```
201+
<App>
202+
<Inbox>
203+
<Message params={ {id: 'Jkei3c32'} } />
204+
</Inbox>
205+
</App>
206+
```
197207

198208
### Getting URL Parameters
199209

0 commit comments

Comments
 (0)