Skip to content

Commit 260c032

Browse files
committed
Handle React.PropTypes deprecations
1 parent 064d527 commit 260c032

File tree

5 files changed

+11
-7
lines changed

5 files changed

+11
-7
lines changed

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,8 @@
9292
"hoist-non-react-statics": "^1.0.3",
9393
"invariant": "^2.0.0",
9494
"lodash": "^4.2.0",
95-
"loose-envify": "^1.1.0"
95+
"loose-envify": "^1.1.0",
96+
"prop-types": "^15.5.4"
9697
},
9798
"peerDependencies": {
9899
"react": "^0.14.0 || ^15.0.0-0 || ^15.4.0-0 || ^16.0.0-0",

src/components/Provider.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import { Component, PropTypes, Children } from 'react'
1+
import { Component, Children } from 'react'
2+
import PropTypes from 'prop-types'
23
import storeShape from '../utils/storeShape'
34
import warning from '../utils/warning'
45

src/utils/storeShape.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { PropTypes } from 'react'
1+
import PropTypes from 'prop-types'
22

33
export default PropTypes.shape({
44
subscribe: PropTypes.func.isRequired,

test/components/Provider.spec.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import expect from 'expect'
2-
import React, { PropTypes, Component } from 'react'
2+
import React, { Component } from 'react'
3+
import PropTypes from 'prop-types'
34
import TestUtils from 'react-addons-test-utils'
45
import { createStore } from 'redux'
56
import { Provider } from '../../src/index'

test/components/connect.spec.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import expect from 'expect'
2-
import React, { createClass, Children, PropTypes, Component } from 'react'
2+
import React, { createClass, Children, Component } from 'react'
3+
import PropTypes from 'prop-types'
34
import ReactDOM from 'react-dom'
45
import TestUtils from 'react-addons-test-utils'
56
import { createStore } from 'redux'
@@ -1381,7 +1382,7 @@ describe('React', () => {
13811382
}
13821383

13831384
ImpureComponent.contextTypes = {
1384-
statefulValue: React.PropTypes.number
1385+
statefulValue: PropTypes.number
13851386
}
13861387

13871388
const decorator = connect(state => state, null, null, { pure: false })
@@ -1405,7 +1406,7 @@ describe('React', () => {
14051406
}
14061407

14071408
StatefulWrapper.childContextTypes = {
1408-
statefulValue: React.PropTypes.number
1409+
statefulValue: PropTypes.number
14091410
}
14101411

14111412
const tree = TestUtils.renderIntoDocument(

0 commit comments

Comments
 (0)