diff --git a/lib/Canvas.js b/lib/Canvas.js index 00e51ef..586e712 100644 --- a/lib/Canvas.js +++ b/lib/Canvas.js @@ -1,16 +1,19 @@ 'use strict'; var React = require('react'); +var PropTypes = require('prop-types'); +var createReactClass = require('create-react-class'); + var { View, WebView } = require('react-native'); -var Canvas = React.createClass({ +var Canvas = createReactClass({ propTypes: { - style: React.PropTypes.object, - context: React.PropTypes.object, - render: React.PropTypes.func.isRequired + style: PropTypes.object, + context: PropTypes.object, + render: PropTypes.func.isRequired }, render() { diff --git a/lib/QRCode.js b/lib/QRCode.js index fdac197..cbde837 100644 --- a/lib/QRCode.js +++ b/lib/QRCode.js @@ -1,6 +1,8 @@ 'use strict'; var React = require('react'); +var PropTypes = require('prop-types'); +var createReactClass = require('create-react-class'); var Canvas = require('./Canvas.js'); var qr = require('qr.js'); var { @@ -45,12 +47,12 @@ function renderCanvas(canvas) { }); } -var QRCode = React.createClass({ +var QRCode = createReactClass({ PropTypes: { - value: React.PropTypes.string, - size: React.PropTypes.number, - bgColor: React.PropTypes.string, - fgColor: React.PropTypes.string, + value: PropTypes.string, + size: PropTypes.number, + bgColor: PropTypes.string, + fgColor: PropTypes.string, }, getDefaultProps: function() { @@ -104,4 +106,4 @@ var QRCode = React.createClass({ }); -module.exports = QRCode; \ No newline at end of file +module.exports = QRCode; diff --git a/package.json b/package.json index 34801a2..69eeb6a 100644 --- a/package.json +++ b/package.json @@ -18,6 +18,8 @@ }, "homepage": "https://github.com/cssivision/react-native-qrcode#readme", "dependencies": { + "create-react-class": "^15.6.0", + "prop-types": "^15.5.10", "qr.js": "0.0.0" } }