Skip to content

Commit

Permalink
React.PropTypes is deprecated: Use prop-types package
Browse files Browse the repository at this point in the history
  • Loading branch information
Edwin committed Jul 11, 2017
1 parent 7385961 commit 80edfc1
Showing 1 changed file with 25 additions and 24 deletions.
49 changes: 25 additions & 24 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
'use strict';

var React = require('react');
var PropTypes = require('prop-types');
var {
View,
StyleSheet,
Expand Down Expand Up @@ -44,28 +45,28 @@ var styles = StyleSheet.create({
var ModalBox = React.createClass({

propTypes: {
isOpen: React.PropTypes.bool,
isDisabled: React.PropTypes.bool,
startOpen: React.PropTypes.bool,
backdropPressToClose: React.PropTypes.bool,
swipeToClose: React.PropTypes.bool,
swipeThreshold: React.PropTypes.number,
swipeArea: React.PropTypes.number,
position: React.PropTypes.string,
entry: React.PropTypes.string,
backdrop: React.PropTypes.bool,
backdropOpacity: React.PropTypes.number,
backdropColor: React.PropTypes.string,
backdropContent: React.PropTypes.element,
animationDuration: React.PropTypes.number,
backButtonClose: React.PropTypes.bool,
easing: React.PropTypes.func,
coverScreen: React.PropTypes.bool,
keyboardTopOffset: React.PropTypes.number,

onClosed: React.PropTypes.func,
onOpened: React.PropTypes.func,
onClosingState: React.PropTypes.func,
isOpen: PropTypes.bool,
isDisabled: PropTypes.bool,
startOpen: PropTypes.bool,
backdropPressToClose: PropTypes.bool,
swipeToClose: PropTypes.bool,
swipeThreshold: PropTypes.number,
swipeArea: PropTypes.number,
position: PropTypes.string,
entry: PropTypes.string,
backdrop: PropTypes.bool,
backdropOpacity: PropTypes.number,
backdropColor: PropTypes.string,
backdropContent: PropTypes.element,
animationDuration: PropTypes.number,
backButtonClose: PropTypes.bool,
easing: PropTypes.func,
coverScreen: PropTypes.bool,
keyboardTopOffset: PropTypes.number,

onClosed: PropTypes.func,
onOpened: PropTypes.func,
onClosingState: PropTypes.func,
},

getDefaultProps: function () {
Expand Down Expand Up @@ -445,7 +446,7 @@ var ModalBox = React.createClass({
)

if (!this.props.coverScreen) return content;

return (
<Modal onRequestClose={() => this.close()} supportedOrientations={['landscape', 'portrait']} transparent visible={visible}>
{content}
Expand Down Expand Up @@ -479,4 +480,4 @@ var ModalBox = React.createClass({

});

module.exports = ModalBox;
module.exports = ModalBox;

0 comments on commit 80edfc1

Please sign in to comment.