Skip to content

Commit

Permalink
Updates todo example for v0.14
Browse files Browse the repository at this point in the history
  • Loading branch information
npverni committed Oct 7, 2015
1 parent 2cd6b2b commit 57a524f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 10 deletions.
12 changes: 7 additions & 5 deletions docs/basics/ExampleTodoList.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ This is the complete source code of the tiny todo app we built during the [basic

```js
import React from 'react';
import ReactDOM from 'react-dom';
import { createStore } from 'redux';
import { Provider } from 'react-redux';
import App from './containers/App';
Expand All @@ -16,11 +17,11 @@ import todoApp from './reducers';
let store = createStore(todoApp);

let rootElement = document.getElementById('root');
React.render(
// The child must be wrapped in a function
// to work around an issue in React 0.13.
ReactDOM.render(
// In React 0.13 the child must be wrapped in a function
// i.e.: {() => <App />}
<Provider store={store}>
{() => <App />}
<App />
</Provider>,
rootElement
);
Expand Down Expand Up @@ -190,7 +191,8 @@ export default connect(select)(App);
#### `components/AddTodo.js`

```js
import React, { findDOMNode, Component, PropTypes } from 'react';
import React, { Component, PropTypes } from 'react';
import { findDOMNode } from 'react-dom';

export default class AddTodo extends Component {
render() {
Expand Down
12 changes: 7 additions & 5 deletions docs/basics/UsageWithReact.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,8 @@ These are all normal React components, so we won’t stop to examine them in det
#### `components/AddTodo.js`

```js
import React, { findDOMNode, Component, PropTypes } from 'react';
import React, { Component, PropTypes } from 'react';
import { findDOMNode } from 'react-dom';

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

```js
import React from 'react';
import ReactDOM from 'react-dom';
import { createStore } from 'redux';
import { Provider } from 'react-redux';
import App from './containers/App';
Expand All @@ -282,11 +284,11 @@ import todoApp from './reducers';
let store = createStore(todoApp);

let rootElement = document.getElementById('root');
React.render(
// The child must be wrapped in a function
// to work around an issue in React 0.13.
ReactDOM.render(
// In React 0.13 the child must be wrapped in a function
// i.e.: {() => <App />}
<Provider store={store}>
{() => <App />}
<App />
</Provider>,
rootElement
);
Expand Down

0 comments on commit 57a524f

Please sign in to comment.