Gracefully deprecate View.propTypes

This commit is contained in:
Kyle 2017-08-02 10:33:03 -04:00
parent d83b01e82c
commit 5c18fb656c
2 changed files with 7 additions and 1 deletions

View File

@ -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,

5
lib/index.js Normal file
View File

@ -0,0 +1,5 @@
import { ViewPropTypes as RNViewPropTypes, View } from 'react-native'
const ViewPropTypes = RNViewPropTypes || View.propTypes
export { ViewPropTypes }