Merge pull request #313 from brunohkbx/fix/blur-view-prop-types

fix(BlurView): Add PropTypes to viewRef according docs
This commit is contained in:
Mikael Sand 2019-11-08 23:21:28 +02:00 committed by GitHub
commit cd214df3e9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -5,6 +5,7 @@ import {
requireNativeComponent,
DeviceEventEmitter,
ViewPropTypes,
Platform,
} from 'react-native';
const OVERLAY_COLORS = {
@ -65,8 +66,8 @@ class BlurView extends Component {
if (this.props.children != null) {
throw new Error(
'[ReactNativeBlur]: BlurView cannot contain any child views on Android. ' +
'You should use "position: absolute" on the BlurView, ' +
'and place other views in front of it.'
'You should use "position: absolute" on the BlurView, ' +
'and place other views in front of it.'
);
}
@ -92,7 +93,10 @@ BlurView.propTypes = {
blurRadius: PropTypes.number,
downsampleFactor: PropTypes.number,
overlayColor: PropTypes.string,
viewRef: PropTypes.number.isRequired,
viewRef: Platform.select({
android: PropTypes.number.isRequired,
default: PropTypes.number,
}),
};
BlurView.defaultProps = {