Skip to content

Commit b1dbbb7

Browse files
committed
fixing "Accessing PropTypes via the main React package is deprecated" warning
1 parent 64ee85f commit b1dbbb7

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,5 +34,8 @@
3434
"react-hot-loader": "1.3.0",
3535
"webpack": "1.13.1",
3636
"webpack-dev-server": "1.14.1"
37+
},
38+
"dependencies": {
39+
"prop-types": "15.5.10"
3740
}
3841
}

src/react-inline-css.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
* @copyright © 2015, Rick Wong. All rights reserved.
33
*/
44
var React = require("react");
5+
var PropTypes = require("prop-types");
56
var assign = Object.assign ? Object.assign : React.__spread;
67
var refCounter = 0;
78

@@ -11,11 +12,11 @@ var refCounter = 0;
1112
var InlineCss = React.createClass({
1213
displayName: "InlineCss",
1314
propTypes: {
14-
namespace: React.PropTypes.string,
15-
componentName: React.PropTypes.string,
16-
stylesheet: React.PropTypes.string.isRequired,
17-
className: React.PropTypes.string,
18-
wrapper: React.PropTypes.string
15+
namespace: PropTypes.string,
16+
componentName: PropTypes.string,
17+
stylesheet: PropTypes.string.isRequired,
18+
className: PropTypes.string,
19+
wrapper: PropTypes.string
1920
},
2021
_transformSheet: function (stylesheet, componentName, namespace) {
2122
return stylesheet.

0 commit comments

Comments
 (0)