Skip to content

Commit 81b5603

Browse files
committedOct 8, 2015
Update react to 0.14.0
1 parent 74126aa commit 81b5603

File tree

2 files changed

+19
-17
lines changed

2 files changed

+19
-17
lines changed
 

‎package.json

+3-2
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,12 @@
4646
"karma-webpack": "^1.7.0",
4747
"mocha": "^2.3.3",
4848
"phantomjs": "^1.9.18",
49-
"react": ">=0.12.0 <0.14.0",
49+
"react": "^0.14.0",
50+
"react-dom": "^0.14.0",
5051
"sinon": "git://github.com/cjohansen/Sinon.JS#b672042043517b9f84e14ed0fb8265126168778a",
5152
"webpack": "^1.12.2"
5253
},
5354
"peerDependencies": {
54-
"react": ">=0.12.0 <0.14.0"
55+
"react": "^0.14.0"
5556
}
5657
}

‎test/components/Switcher_test.js

+16-15
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import React, {Component, PropTypes} from 'react';
2+
import ReactDOM from 'react-dom';
23
import {assert} from 'chai';
34
import sinon from 'sinon';
45
import window from 'window';
@@ -19,7 +20,7 @@ describe('Switcher', function() {
1920
describe('#getLocation', function() {
2021
describe('using location.hash', function() {
2122
beforeEach(function() {
22-
this.switcher = React.render(
23+
this.switcher = ReactDOM.render(
2324
<Switcher>
2425
<div path="/">Home</div>
2526
<div path="/another">Another</div>
@@ -53,7 +54,7 @@ describe('Switcher', function() {
5354

5455
describe('using location.pathname', function() {
5556
beforeEach(function() {
56-
this.switcher = React.render(
57+
this.switcher = ReactDOM.render(
5758
<Switcher location="pathname">
5859
<div path="/">Home</div>
5960
<div path="/another">Another</div>
@@ -89,7 +90,7 @@ describe('Switcher', function() {
8990
describe('#getSwitch', function() {
9091
describe('default', function() {
9192
beforeEach(function() {
92-
this.switcher = React.render(
93+
this.switcher = ReactDOM.render(
9394
<Switcher>
9495
<div path="/">Home</div>
9596
<div path="/another">Another</div>
@@ -151,7 +152,7 @@ describe('Switcher', function() {
151152

152153
describe('with basepath set', function() {
153154
beforeEach(function() {
154-
this.switcher = React.render(
155+
this.switcher = ReactDOM.render(
155156
<Switcher basePath="/base">
156157
<div path="/">Home</div>
157158
<div path="/another">Another</div>
@@ -176,7 +177,7 @@ describe('Switcher', function() {
176177
describe('#handleRouteChange', function() {
177178
describe('default', function() {
178179
beforeEach(function() {
179-
this.switcher = React.render(
180+
this.switcher = ReactDOM.render(
180181
<Switcher>
181182
<div path="/">Home</div>
182183
</Switcher>,
@@ -200,7 +201,7 @@ describe('Switcher', function() {
200201
describe('with onChange function defined', function() {
201202
beforeEach(function() {
202203
this.handleChange = sinon.spy();
203-
this.switcher = React.render(
204+
this.switcher = ReactDOM.render(
204205
<Switcher onChange={this.handleChange}>
205206
<div path="/">Home</div>
206207
</Switcher>,
@@ -222,7 +223,7 @@ describe('Switcher', function() {
222223
describe('#render', function() {
223224
describe('default', function() {
224225
beforeEach(function() {
225-
this.switcher = React.render(
226+
this.switcher = ReactDOM.render(
226227
<Switcher>
227228
<div path="/">Home</div>
228229
</Switcher>,
@@ -237,22 +238,22 @@ describe('Switcher', function() {
237238
it('renders nothing if no match', function() {
238239
window.location.hash = '/nomatch';
239240
this.switcher.handleRouteChange();
240-
var node = React.findDOMNode(this.switcher);
241+
var node = ReactDOM.findDOMNode(this.switcher);
241242
assert.isNull(node);
242243
});
243244

244245
it('renders matching component', function() {
245246
window.location.hash = '/';
246247
this.switcher.handleRouteChange();
247-
var node = React.findDOMNode(this.switcher);
248+
var node = ReactDOM.findDOMNode(this.switcher);
248249
assert.equal(node.innerHTML, 'Home');
249250
});
250251
});
251252

252253
describe('with default handler', function() {
253254
beforeEach(function() {
254255
var props = {text: 'Hello'};
255-
this.switcher = React.render(
256+
this.switcher = ReactDOM.render(
256257
<Switcher
257258
defaultHandler={Handler}
258259
defaultHandlerProps={props}>
@@ -269,21 +270,21 @@ describe('Switcher', function() {
269270
it('renders default handler when no match', function() {
270271
window.location.hash = '/nomatch';
271272
this.switcher.handleRouteChange();
272-
var node = React.findDOMNode(this.switcher);
273+
var node = ReactDOM.findDOMNode(this.switcher);
273274
assert.equal(node.innerHTML, 'Hello');
274275
});
275276

276277
it('renders matching component', function() {
277278
window.location.hash = '/';
278279
this.switcher.handleRouteChange();
279-
var node = React.findDOMNode(this.switcher);
280+
var node = ReactDOM.findDOMNode(this.switcher);
280281
assert.equal(node.innerHTML, 'Home');
281282
});
282283
});
283284

284285
describe('with wrapper', function() {
285286
beforeEach(function() {
286-
this.switcher = React.render(
287+
this.switcher = ReactDOM.render(
287288
<Switcher wrapper="span">
288289
<div path="/">Home</div>
289290
</Switcher>,
@@ -298,15 +299,15 @@ describe('Switcher', function() {
298299
it('renders just wrapper when no match', function() {
299300
window.location.hash = '/nomatch';
300301
this.switcher.handleRouteChange();
301-
var wrapper = React.findDOMNode(this.switcher);
302+
var wrapper = ReactDOM.findDOMNode(this.switcher);
302303
assert.equal(wrapper.innerHTML, '');
303304
assert.equal(wrapper.tagName, 'SPAN');
304305
});
305306

306307
it('renders matched component in wrapper', function() {
307308
window.location.hash = '/';
308309
this.switcher.handleRouteChange();
309-
var wrapper = React.findDOMNode(this.switcher);
310+
var wrapper = ReactDOM.findDOMNode(this.switcher);
310311
var component = wrapper.children[0];
311312
assert.equal(wrapper.tagName, 'SPAN');
312313
assert.equal(component.innerHTML, 'Home');

0 commit comments

Comments
 (0)
Please sign in to comment.