Skip to content

Commit 57a524f

Browse files
committed
Updates todo example for v0.14
1 parent 2cd6b2b commit 57a524f

File tree

2 files changed

+14
-10
lines changed

2 files changed

+14
-10
lines changed

docs/basics/ExampleTodoList.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ This is the complete source code of the tiny todo app we built during the [basic
88

99
```js
1010
import React from 'react';
11+
import ReactDOM from 'react-dom';
1112
import { createStore } from 'redux';
1213
import { Provider } from 'react-redux';
1314
import App from './containers/App';
@@ -16,11 +17,11 @@ import todoApp from './reducers';
1617
let store = createStore(todoApp);
1718

1819
let rootElement = document.getElementById('root');
19-
React.render(
20-
// The child must be wrapped in a function
21-
// to work around an issue in React 0.13.
20+
ReactDOM.render(
21+
// In React 0.13 the child must be wrapped in a function
22+
// i.e.: {() => <App />}
2223
<Provider store={store}>
23-
{() => <App />}
24+
<App />
2425
</Provider>,
2526
rootElement
2627
);
@@ -190,7 +191,8 @@ export default connect(select)(App);
190191
#### `components/AddTodo.js`
191192

192193
```js
193-
import React, { findDOMNode, Component, PropTypes } from 'react';
194+
import React, { Component, PropTypes } from 'react';
195+
import { findDOMNode } from 'react-dom';
194196

195197
export default class AddTodo extends Component {
196198
render() {

docs/basics/UsageWithReact.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,8 @@ These are all normal React components, so we won’t stop to examine them in det
8888
#### `components/AddTodo.js`
8989

9090
```js
91-
import React, { findDOMNode, Component, PropTypes } from 'react';
91+
import React, { Component, PropTypes } from 'react';
92+
import { findDOMNode } from 'react-dom';
9293

9394
export default class AddTodo extends Component {
9495
render() {
@@ -274,6 +275,7 @@ First, we need to import `Provider` from [`react-redux`](http://github.com/gaear
274275

275276
```js
276277
import React from 'react';
278+
import ReactDOM from 'react-dom';
277279
import { createStore } from 'redux';
278280
import { Provider } from 'react-redux';
279281
import App from './containers/App';
@@ -282,11 +284,11 @@ import todoApp from './reducers';
282284
let store = createStore(todoApp);
283285

284286
let rootElement = document.getElementById('root');
285-
React.render(
286-
// The child must be wrapped in a function
287-
// to work around an issue in React 0.13.
287+
ReactDOM.render(
288+
// In React 0.13 the child must be wrapped in a function
289+
// i.e.: {() => <App />}
288290
<Provider store={store}>
289-
{() => <App />}
291+
<App />
290292
</Provider>,
291293
rootElement
292294
);

0 commit comments

Comments
 (0)