@@ -14,10 +14,6 @@ describe('React', () => {
14
14
}
15
15
16
16
class ProviderMock extends Component {
17
- static childContextTypes = {
18
- store : PropTypes . object . isRequired
19
- }
20
-
21
17
getChildContext ( ) {
22
18
return { store : this . props . store }
23
19
}
@@ -27,6 +23,10 @@ describe('React', () => {
27
23
}
28
24
}
29
25
26
+ ProviderMock . childContextTypes = {
27
+ store : PropTypes . object . isRequired
28
+ }
29
+
30
30
function stringBuilder ( prev = '' , action ) {
31
31
return action . type === 'APPEND'
32
32
? prev + action . body
@@ -1184,14 +1184,14 @@ describe('React', () => {
1184
1184
1185
1185
it ( 'should hoist non-react statics from wrapped component' , ( ) => {
1186
1186
class Container extends Component {
1187
- static howIsRedux = ( ) => 'Awesome!'
1188
- static foo = 'bar'
1189
-
1190
1187
render ( ) {
1191
1188
return < Passthrough />
1192
1189
}
1193
1190
}
1194
1191
1192
+ Container . howIsRedux = ( ) => 'Awesome!'
1193
+ Container . foo = 'bar'
1194
+
1195
1195
const decorator = connect ( state => state )
1196
1196
const decorated = decorator ( Container )
1197
1197
@@ -1304,25 +1304,22 @@ describe('React', () => {
1304
1304
const store = createStore ( ( ) => ( { } ) )
1305
1305
1306
1306
class ImpureComponent extends Component {
1307
- static contextTypes = {
1308
- statefulValue : React . PropTypes . number
1309
- }
1310
-
1311
1307
render ( ) {
1312
1308
return < Passthrough statefulValue = { this . context . statefulValue } />
1313
1309
}
1314
1310
}
1315
1311
1312
+ ImpureComponent . contextTypes = {
1313
+ statefulValue : React . PropTypes . number
1314
+ }
1315
+
1316
1316
const decorator = connect ( state => state , null , null , { pure : false } )
1317
1317
const Decorated = decorator ( ImpureComponent )
1318
1318
1319
1319
class StatefulWrapper extends Component {
1320
- state = {
1321
- value : 0
1322
- }
1323
-
1324
- static childContextTypes = {
1325
- statefulValue : React . PropTypes . number
1320
+ constructor ( ) {
1321
+ super ( )
1322
+ this . state = { value : 0 }
1326
1323
}
1327
1324
1328
1325
getChildContext ( ) {
@@ -1336,6 +1333,10 @@ describe('React', () => {
1336
1333
}
1337
1334
}
1338
1335
1336
+ StatefulWrapper . childContextTypes = {
1337
+ statefulValue : React . PropTypes . number
1338
+ }
1339
+
1339
1340
const tree = TestUtils . renderIntoDocument (
1340
1341
< ProviderMock store = { store } >
1341
1342
< StatefulWrapper />
@@ -1376,15 +1377,18 @@ describe('React', () => {
1376
1377
const Decorated = decorator ( ImpureComponent )
1377
1378
1378
1379
class StatefulWrapper extends Component {
1379
- state = {
1380
- storeGetter : { storeKey : 'foo' }
1380
+ constructor ( ) {
1381
+ super ( )
1382
+ this . state = {
1383
+ storeGetter : { storeKey : 'foo' }
1384
+ }
1381
1385
}
1382
-
1383
1386
render ( ) {
1384
1387
return < Decorated storeGetter = { this . state . storeGetter } />
1385
1388
}
1386
1389
}
1387
1390
1391
+
1388
1392
const tree = TestUtils . renderIntoDocument (
1389
1393
< ProviderMock store = { store } >
1390
1394
< StatefulWrapper />
0 commit comments