From 20c40eda100418e66868a49ce4d22bc9e45bfd2b Mon Sep 17 00:00:00 2001 From: Uncle Charlie Date: Fri, 4 May 2018 14:51:22 +0800 Subject: [PATCH] use separate prop-types lib --- library/transform/ViewTransformer.js | 28 ++++++++++++---------------- 1 file changed, 12 insertions(+), 16 deletions(-) diff --git a/library/transform/ViewTransformer.js b/library/transform/ViewTransformer.js index f97ab00..838e95f 100644 --- a/library/transform/ViewTransformer.js +++ b/library/transform/ViewTransformer.js @@ -7,6 +7,7 @@ import ReactNative, { Easing, NativeModules } from 'react-native'; +import PropTypes from 'prop-types'; import {createResponder} from 'react-native-gesture-responder'; import Scroller from 'react-native-scroller'; @@ -88,10 +89,7 @@ export default class ViewTransformer extends React.Component { onResponderGrant: this.onResponderGrant.bind(this), onResponderRelease: this.onResponderRelease.bind(this), onResponderTerminate: this.onResponderRelease.bind(this), - onResponderTerminationRequest: (evt, gestureState) => false, //Do not allow parent view to intercept gesture - onResponderSingleTapConfirmed: (evt, gestureState) => { - this.props.onSingleTapConfirmed && this.props.onSingleTapConfirmed(); - } + onResponderTerminationRequest: (evt, gestureState) => false //Do not allow parent view to intercept gesture }); } @@ -421,36 +419,34 @@ ViewTransformer.propTypes = { /** * Use false to disable transform. Default is true. */ - enableTransform: React.PropTypes.bool, + enableTransform: PropTypes.bool, /** * Use false to disable scaling. Default is true. */ - enableScale: React.PropTypes.bool, + enableScale: PropTypes.bool, /** * Use false to disable translateX/translateY. Default is true. */ - enableTranslate: React.PropTypes.bool, + enableTranslate: PropTypes.bool, /** * Default is 20 */ - maxOverScrollDistance: React.PropTypes.number, + maxOverScrollDistance: PropTypes.number, - maxScale: React.PropTypes.number, - contentAspectRatio: React.PropTypes.number, + maxScale: PropTypes.number, + contentAspectRatio: PropTypes.number, /** * Use true to enable resistance effect on over pulling. Default is false. */ - enableResistance: React.PropTypes.bool, - - onViewTransformed: React.PropTypes.func, + enableResistance: PropTypes.bool, - onTransformGestureReleased: React.PropTypes.func, + onViewTransformed: PropTypes.func, - onSingleTapConfirmed: React.PropTypes.func + onTransformGestureReleased: PropTypes.func }; ViewTransformer.defaultProps = { maxOverScrollDistance: 20, @@ -459,4 +455,4 @@ ViewTransformer.defaultProps = { enableTransform: true, maxScale: 1, enableResistance: false -}; +}; \ No newline at end of file