Skip to content

Commit 9421310

Browse files
committed
Update todomvc example to React 0.14
1 parent 18337d5 commit 9421310

File tree

7 files changed

+17
-20
lines changed

7 files changed

+17
-20
lines changed

examples/todomvc/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
import 'babel-core/polyfill';
2-
32
import React from 'react';
3+
import { render } from 'react-dom';
44
import { Provider } from 'react-redux';
55
import App from './containers/App';
66
import configureStore from './store/configureStore';
77
import 'todomvc-app-css/index.css';
88

99
const store = configureStore();
1010

11-
React.render(
11+
render(
1212
<Provider store={store}>
13-
{() => <App />}
13+
<App />
1414
</Provider>,
1515
document.getElementById('root')
1616
);

examples/todomvc/package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,9 @@
1818
"homepage": "http://rackt.github.io/redux",
1919
"dependencies": {
2020
"classnames": "^2.1.2",
21-
"react": "^0.13.3",
22-
"react-redux": "^2.1.2",
21+
"react": "^0.14.0",
22+
"react-dom": "^0.14.0",
23+
"react-redux": "^4.0.0",
2324
"redux": "^3.0.0"
2425
},
2526
"devDependencies": {
@@ -32,6 +33,7 @@
3233
"mocha": "^2.2.5",
3334
"node-libs-browser": "^0.5.2",
3435
"raw-loader": "^0.5.1",
36+
"react-addons-test-utils": "^0.14.0",
3537
"react-transform-hmr": "^1.0.0",
3638
"style-loader": "^0.12.3",
3739
"todomvc-app-css": "^2.0.1",

examples/todomvc/test/components/Footer.spec.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
import expect from 'expect';
2-
import React from 'react/addons';
2+
import React from 'react';
3+
import TestUtils from 'react-addons-test-utils';
34
import Footer from '../../components/Footer';
45
import { SHOW_ALL, SHOW_ACTIVE } from '../../constants/TodoFilters';
56

6-
const { TestUtils } = React.addons;
7-
87
function setup(propOverrides) {
98
const props = Object.assign({
109
completedCount: 0,

examples/todomvc/test/components/Header.spec.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
import expect from 'expect';
2-
import React from 'react/addons';
2+
import React from 'react';
3+
import TestUtils from 'react-addons-test-utils';
34
import Header from '../../components/Header';
45
import TodoTextInput from '../../components/TodoTextInput';
56

6-
const { TestUtils } = React.addons;
7-
87
function setup() {
98
const props = {
109
addTodo: expect.createSpy()

examples/todomvc/test/components/MainSection.spec.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
import expect from 'expect';
2-
import React from 'react/addons';
2+
import React from 'react';
3+
import TestUtils from 'react-addons-test-utils';
34
import MainSection from '../../components/MainSection';
45
import TodoItem from '../../components/TodoItem';
56
import Footer from '../../components/Footer';
67
import { SHOW_ALL, SHOW_COMPLETED } from '../../constants/TodoFilters';
78

8-
const { TestUtils } = React.addons;
9-
109
function setup(propOverrides) {
1110
const props = Object.assign({
1211
todos: [{

examples/todomvc/test/components/TodoItem.spec.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
11
import expect from 'expect';
2-
import React from 'react/addons';
2+
import React from 'react';
3+
import TestUtils from 'react-addons-test-utils';
34
import TodoItem from '../../components/TodoItem';
45
import TodoTextInput from '../../components/TodoTextInput';
56

6-
const { TestUtils } = React.addons;
7-
87
function setup( editing = false ) {
98
const props = {
109
todo: {

examples/todomvc/test/components/TodoTextInput.spec.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
import expect from 'expect';
2-
import React from 'react/addons';
2+
import React from 'react';
3+
import TestUtils from 'react-addons-test-utils';
34
import TodoTextInput from '../../components/TodoTextInput';
45

5-
const { TestUtils } = React.addons;
6-
76
function setup(propOverrides) {
87
const props = Object.assign({
98
onSave: expect.createSpy(),

0 commit comments

Comments
 (0)