Skip to content

Commit da612cf

Browse files
committed
use react-dom in docs
1 parent 9426e4f commit da612cf

File tree

4 files changed

+14
-12
lines changed

4 files changed

+14
-12
lines changed

docs/API.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
- [Router](#router)
55
- [Link](#link)
66
- [IndexLink](#indexlink)
7-
- [RoutingContext](#routingcontext)
7+
- [RoutingContext](#routingcontext)
88

99
* [Configuration Components](#configuration-components)
1010
- [Route](#route)
@@ -18,7 +18,7 @@
1818
* [Mixins](#mixins)
1919
- [Lifecycle](#lifecycle-mixin)
2020
- [History](#history-mixin)
21-
- [RouteContext](#routecontext-mixin)
21+
- [RouteContext](#routecontext-mixin)
2222

2323
* [Utilities](#utilities)
2424
* [useRoutes](#useroutescreatehistory)
@@ -42,7 +42,7 @@ Alias for `children`.
4242
The history the router should listen to from the `history` package.
4343

4444
##### `createElement(Component, props)`
45-
When the router is ready to render a branch of route components, it will use this function to create the elements. You may want to take control of creating the elements when you're using some sort of data abstraction, like setting up subscriptions to stores, or passing in some sort of application module to each component via props.
45+
When the router is ready to render a branch of route components, it will use this function to create the elements. You may want to take control of creating the elements when you're using some sort of data abstraction, like setting up subscriptions to stores, or passing in some sort of application module to each component via props.
4646

4747
```js
4848
<Router createElement={createElement} />
@@ -410,7 +410,7 @@ The matched child route elements to be rendered.
410410

411411
##### Example
412412
```js
413-
React.render((
413+
render((
414414
<Router history={history}>
415415
<Route path="/" component={App}>
416416
<Route path="groups" component={Groups} />
@@ -436,7 +436,7 @@ When a route has multiple components, the child elements are available by name o
436436

437437
#### Example
438438
```js
439-
React.render((
439+
render((
440440
<Router>
441441
<Route path="/" component={App}>
442442
<Route path="groups" components={{main: Groups, sidebar: GroupsSidebar}} />

docs/guides/basics/Histories.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,14 +92,15 @@ Memory history doesn't manipulate or read from the address bar. This is how we i
9292
## Example implementation
9393
```js
9494
import React from 'react'
95+
import { render } from 'react-dom'
9596
import createBrowserHistory from 'history/lib/createBrowserHistory'
9697
import { Router, Route, IndexRoute } from 'react-router'
9798
import App from '../components/App'
9899
import Home from '../components/Home'
99100
import About from '../components/About'
100101
import Features from '../components/Features'
101102

102-
React.render(
103+
render(
103104
<Router history={createBrowserHistory()}>
104105
<Route path='/' component={App}>
105106
<IndexRoute component={Home} />

docs/guides/basics/RouteConfiguration.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ A [route configuration](/docs/Glossary.md#routeconfig) is basically a set of ins
44

55
```js
66
import React from 'react'
7+
import { render } from 'react-dom'
78
import { Router, Route, Link } from 'react-router'
89

910
const App = React.createClass({
@@ -44,7 +45,7 @@ const Message = React.createClass({
4445
}
4546
})
4647

47-
React.render((
48+
render((
4849
<Router>
4950
<Route path="/" component={App}>
5051
<Route path="about" component={About} />
@@ -78,7 +79,7 @@ const Dashboard = React.createClass({
7879
}
7980
})
8081

81-
React.render((
82+
render((
8283
<Router>
8384
<Route path="/" component={App}>
8485
{/* Show the dashboard at / */}
@@ -108,7 +109,7 @@ URL | Components
108109
It would be nice if we could remove the `/inbox` segment from the `/inbox/messages/:id` URL pattern, but still render `Message` nested inside the `App -> Inbox` UI. Absolute `path`s let us do exactly that.
109110

110111
```js
111-
React.render((
112+
render((
112113
<Router>
113114
<Route path="/" component={App}>
114115
<IndexRoute component={Dashboard} />
@@ -144,7 +145,7 @@ Not to worry. We can use a [`<Redirect>`](/docs/API.md#redirect) to make sure th
144145
```js
145146
import { Redirect } from 'react-router'
146147

147-
React.render((
148+
render((
148149
<Router>
149150
<Route path="/" component={App}>
150151
<IndexRoute component={Dashboard} />
@@ -202,5 +203,5 @@ const routeConfig = [
202203
}
203204
]
204205

205-
React.render(<Router routes={routeConfig} />, document.body)
206+
render(<Router routes={routeConfig} />, document.body)
206207
```

examples/huge-apps/app.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ render(
4747
// import Grades from './routes/Grades/components/Grades'
4848
// import Messages from './routes/Messages/components/Messages'
4949

50-
// React.render(
50+
// render(
5151
// <Router>
5252
// <Route path="/" component={App}>
5353
// <Route path="calendar" component={Calendar} />

0 commit comments

Comments
 (0)