Skip to content

Commit c0f366d

Browse files
committed
update UsageWithReact.md to React 0.14
1 parent 94ac8f7 commit c0f366d

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

docs/basics/UsageWithReact.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ 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';
9292

9393
export default class AddTodo extends Component {
9494
render() {
@@ -103,7 +103,7 @@ export default class AddTodo extends Component {
103103
}
104104

105105
handleClick(e) {
106-
const node = findDOMNode(this.refs.input);
106+
const node = this.refs.input;
107107
const text = node.value.trim();
108108
this.props.onAddClick(text);
109109
node.value = '';
@@ -274,6 +274,7 @@ First, we need to import `Provider` from [`react-redux`](http://github.com/gaear
274274

275275
```js
276276
import React from 'react';
277+
import { render } from 'react-dom';
277278
import { createStore } from 'redux';
278279
import { Provider } from 'react-redux';
279280
import App from './containers/App';
@@ -282,11 +283,11 @@ import todoApp from './reducers';
282283
let store = createStore(todoApp);
283284

284285
let rootElement = document.getElementById('root');
285-
React.render(
286+
render(
286287
// The child must be wrapped in a function
287288
// to work around an issue in React 0.13.
288289
<Provider store={store}>
289-
{() => <App />}
290+
<App />
290291
</Provider>,
291292
rootElement
292293
);

0 commit comments

Comments
 (0)