Skip to content

Commit 16615c3

Browse files
committed
add support for React 16 (prop-types, create-react-class)
1 parent acce74d commit 16615c3

File tree

2 files changed

+10
-6
lines changed

2 files changed

+10
-6
lines changed

lib/WindowResizeListener.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,11 @@
33
* React component for listening to window resize events
44
*/
55
var React = require('react')
6+
var PropTypes = require('prop-types')
7+
var createReactClass = require('create-react-class')
68
var debounce = require('lodash.debounce')
79

8-
var WindowResizeListener = React.createClass({
10+
var WindowResizeListener = createReactClass({
911
displayName: 'WindowResizeListener',
1012

1113
propTypes: {
@@ -14,7 +16,7 @@ var WindowResizeListener = React.createClass({
1416
* type WindowSize = { windowWidth: number, windowHeight: number }
1517
* type onResize = (windowSize: WindowSize) => void
1618
*/
17-
onResize: React.PropTypes.func.isRequired
19+
onResize: PropTypes.func.isRequired
1820
},
1921

2022
statics: {

package.json

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,18 @@
2929
"homepage": "https://github.com/cesarandreu/react-window-resize-listener#readme",
3030
"devDependencies": {
3131
"phantomjs": "^1.9.18",
32-
"react": "^0.14.0 || ^15.0.0",
33-
"react-dom": "^0.14.0 || ^15.0.0",
32+
"react": "^0.14.0 || ^15.0.0 || ^16.0.0",
33+
"react-dom": "^0.14.0 || ^15.0.0 || ^16.0.0",
3434
"standard": "^5.3.1",
3535
"tape": "^4.2.2",
3636
"zuul": "^3.7.1"
3737
},
3838
"dependencies": {
39-
"lodash.debounce": "^3.1.1"
39+
"create-react-class": "^15.6.3",
40+
"lodash.debounce": "^3.1.1",
41+
"prop-types": "^15.6.2"
4042
},
4143
"peerDependencies": {
42-
"react": "^0.14.0 || ^15.0.0"
44+
"react": "^0.14.0 || ^15.0.0 || ^16.0.0"
4345
}
4446
}

0 commit comments

Comments
 (0)