diff --git a/package.json b/package.json index 8a55947..eafb5cf 100644 --- a/package.json +++ b/package.json @@ -34,6 +34,9 @@ ], "author": "Jack Hsu (http://jaysoo.ca/)", "license": "ISC", + "dependencies": { + "prop-types": "^15.6.0" + }, "devDependencies": { "appium": "^1.4.16", "babel-core": "^6.4.0", diff --git a/src/Prompt.js b/src/Prompt.js index d778d0a..cb45cdc 100644 --- a/src/Prompt.js +++ b/src/Prompt.js @@ -1,4 +1,4 @@ -import React, { Component, PropTypes } from 'react'; +import React, { Component } from 'react'; import { Modal, Platform, @@ -7,6 +7,7 @@ import { TouchableWithoutFeedback, View } from 'react-native'; +import PropTypes from 'prop-types'; import styles from './styles'; export default class Prompt extends Component { @@ -15,11 +16,12 @@ export default class Prompt extends Component { visible: PropTypes.bool, defaultValue: PropTypes.string, placeholder: PropTypes.string, - onCancel: PropTypes.func.isRequired, + onCancel: PropTypes.func, cancelText: PropTypes.string, + cancelable: PropTypes.bool, onSubmit: PropTypes.func.isRequired, submitText: PropTypes.string, - onChangeText: PropTypes.func.isRequired, + onChangeText: PropTypes.func, borderColor: PropTypes.string, promptStyle: PropTypes.object, titleStyle: PropTypes.object, @@ -45,6 +47,7 @@ export default class Prompt extends Component { buttonTextStyle: {}, submitButtonStyle: {}, submitButtonTextStyle: {}, + cancelable: true, cancelButtonStyle: {}, cancelButtonTextStyle: {}, inputStyle: {},