From a3b9a946c4c4bef8cdcb76c2789032d6a66fe18f Mon Sep 17 00:00:00 2001 From: booker0108 Date: Sat, 26 Aug 2017 15:42:52 +0800 Subject: [PATCH] Add ViewPropTypes fallback support --- src/index.js | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/index.js b/src/index.js index d77cf98..94ebfb5 100644 --- a/src/index.js +++ b/src/index.js @@ -6,6 +6,8 @@ import {PropTypes} from 'prop-types'; function noop() {} +const viewPropTypes = ViewPropTypes || View.propTypes; + export default class Swipeable extends PureComponent { static propTypes = { @@ -76,12 +78,12 @@ export default class Swipeable extends PureComponent { swipeStartMinDistance: PropTypes.number, // styles - style: ViewPropTypes.style, - leftContainerStyle: ViewPropTypes.style, - leftButtonContainerStyle: ViewPropTypes.style, - rightContainerStyle: ViewPropTypes.style, - rightButtonContainerStyle: ViewPropTypes.style, - contentContainerStyle: ViewPropTypes.style + style: viewPropTypes.style, + leftContainerStyle: viewPropTypes.style, + leftButtonContainerStyle: viewPropTypes.style, + rightContainerStyle: viewPropTypes.style, + rightButtonContainerStyle: viewPropTypes.style, + contentContainerStyle: viewPropTypes.style }; static defaultProps = {