diff --git a/Libraries/Components/Touchable/TouchableFeedbackPropType.js b/Libraries/Components/Touchable/TouchableFeedbackPropType.js deleted file mode 100644 index 336b091c6..000000000 --- a/Libraries/Components/Touchable/TouchableFeedbackPropType.js +++ /dev/null @@ -1,22 +0,0 @@ -/** - * Copyright 2004-present Facebook. All Rights Reserved. - * - * @providesModule TouchableFeedbackPropType - * @flow - */ -'use strict'; - -var { PropTypes } = require('React'); - -var TouchableFeedbackPropType = { - /** - * Called when the touch is released, but not if cancelled (e.g. by a scroll - * that steals the responder lock). - */ - onPress: PropTypes.func, - onPressIn: PropTypes.func, - onPressOut: PropTypes.func, - onLongPress: PropTypes.func, -}; - -module.exports = TouchableFeedbackPropType; diff --git a/Libraries/Components/Touchable/TouchableHighlight.js b/Libraries/Components/Touchable/TouchableHighlight.js index e00b847e8..11b7a6a47 100644 --- a/Libraries/Components/Touchable/TouchableHighlight.js +++ b/Libraries/Components/Touchable/TouchableHighlight.js @@ -11,7 +11,7 @@ var ReactIOSViewAttributes = require('ReactIOSViewAttributes'); var StyleSheet = require('StyleSheet'); var TimerMixin = require('TimerMixin'); var Touchable = require('Touchable'); -var TouchableFeedbackPropType = require('TouchableFeedbackPropType'); +var TouchableWithoutFeedback = require('TouchableWithoutFeedback'); var View = require('View'); var cloneWithProps = require('cloneWithProps'); @@ -51,12 +51,7 @@ var DEFAULT_PROPS = { var TouchableHighlight = React.createClass({ propTypes: { - ...TouchableFeedbackPropType, - /** - * Called when the touch is released, but not if cancelled (e.g. by - * a scroll that steals the responder lock). - */ - onPress: React.PropTypes.func.isRequired, + ...TouchableWithoutFeedback.propTypes, /** * Determines what the opacity of the wrapped view should be when touch is * active. diff --git a/Libraries/Components/Touchable/TouchableOpacity.js b/Libraries/Components/Touchable/TouchableOpacity.js index 1b2f3898f..549df36a8 100644 --- a/Libraries/Components/Touchable/TouchableOpacity.js +++ b/Libraries/Components/Touchable/TouchableOpacity.js @@ -9,7 +9,7 @@ var NativeMethodsMixin = require('NativeMethodsMixin'); var POPAnimationMixin = require('POPAnimationMixin'); var React = require('React'); var Touchable = require('Touchable'); -var TouchableFeedbackPropType = require('TouchableFeedbackPropType'); +var TouchableWithoutFeedback = require('TouchableWithoutFeedback'); var cloneWithProps = require('cloneWithProps'); var ensureComponentIsNative = require('ensureComponentIsNative'); @@ -42,7 +42,7 @@ var TouchableOpacity = React.createClass({ mixins: [Touchable.Mixin, NativeMethodsMixin, POPAnimationMixin], propTypes: { - ...TouchableFeedbackPropType, + ...TouchableWithoutFeedback.propTypes, /** * Determines what the opacity of the wrapped view should be when touch is * active. diff --git a/Libraries/Components/Touchable/TouchableWithoutFeedback.js b/Libraries/Components/Touchable/TouchableWithoutFeedback.js index ccc784e6a..78544dbc6 100644 --- a/Libraries/Components/Touchable/TouchableWithoutFeedback.js +++ b/Libraries/Components/Touchable/TouchableWithoutFeedback.js @@ -7,7 +7,6 @@ var React = require('React'); var Touchable = require('Touchable'); -var TouchableFeedbackPropType = require('TouchableFeedbackPropType'); var onlyChild = require('onlyChild'); @@ -28,7 +27,16 @@ var PRESS_RECT_OFFSET = {top: 20, left: 20, right: 20, bottom: 30}; var TouchableWithoutFeedback = React.createClass({ mixins: [Touchable.Mixin], - propTypes: TouchableFeedbackPropType, + propTypes: { + /** + * Called when the touch is released, but not if cancelled (e.g. by a scroll + * that steals the responder lock). + */ + onPress: React.PropTypes.func, + onPressIn: React.PropTypes.func, + onPressOut: React.PropTypes.func, + onLongPress: React.PropTypes.func, + }, getInitialState: function() { return this.touchableGetInitialState();