Merge pull request #30 from Dobrokhvalov/master

Migrating from React.createClass
This commit is contained in:
cssivision 2017-07-28 19:55:38 +08:00 committed by GitHub
commit 60c3575a65
3 changed files with 17 additions and 10 deletions

View File

@ -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() {

View File

@ -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;
module.exports = QRCode;

View File

@ -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"
}
}