From 5c18fb656cae56b6795b65e238e85cdc152ca5ae Mon Sep 17 00:00:00 2001 From: Kyle Date: Wed, 2 Aug 2017 10:33:03 -0400 Subject: [PATCH] Gracefully deprecate View.propTypes --- FastImage.js | 3 ++- lib/index.js | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 lib/index.js diff --git a/FastImage.js b/FastImage.js index f669fcd..8583cb4 100644 --- a/FastImage.js +++ b/FastImage.js @@ -6,6 +6,7 @@ import { requireNativeComponent, View, } from 'react-native' +import { ViewPropTypes } from './lib' const resolveAssetSource = require('react-native/Libraries/Image/resolveAssetSource') @@ -87,7 +88,7 @@ const FastImageSourcePropType = PropTypes.shape({ }) FastImage.propTypes = { - ...View.propTypes, + ...ViewPropTypes, source: FastImageSourcePropType, onLoadStart: PropTypes.func, onProgress: PropTypes.func, diff --git a/lib/index.js b/lib/index.js new file mode 100644 index 0000000..4b55447 --- /dev/null +++ b/lib/index.js @@ -0,0 +1,5 @@ +import { ViewPropTypes as RNViewPropTypes, View } from 'react-native' + +const ViewPropTypes = RNViewPropTypes || View.propTypes + +export { ViewPropTypes } \ No newline at end of file