mirror of
https://github.com/status-im/react-native-blur.git
synced 2025-02-16 18:37:03 +00:00
Merge pull request #313 from brunohkbx/fix/blur-view-prop-types
fix(BlurView): Add PropTypes to viewRef according docs
This commit is contained in:
commit
cd214df3e9
@ -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 = {
|
||||
|
Loading…
x
Reference in New Issue
Block a user