import PropTypes from 'prop-types'; import * as React from 'react'; import { View, ViewPropTypes, findNodeHandle } from 'react-native'; import { NativeModulesProxy, requireNativeViewManager } from 'expo-core'; type Props = { tint: BlurTint; intensity: number; } & React.ComponentProps; type BlurTint = 'light' | 'dark' | 'default'; type ComponentOrHandle = null | number | React.Component | React.ComponentClass; export default class BlurView extends React.Component { static propTypes = { ...ViewPropTypes, tint: PropTypes.oneOf(['light', 'default', 'dark'] as BlurTint[]).isRequired, intensity: PropTypes.number.isRequired, }; static defaultProps = { tint: 'default' as BlurTint, intensity: 50, }; _root: ComponentOrHandle = null; _setNativeRef = (ref: ComponentOrHandle) => { this._root = ref; }; setNativeProps = nativeProps => { if (this._root) { NativeModulesProxy.ExpoBlurViewManager.updateProps(nativeProps, findNodeHandle(this._root)); } }; render() { let { style, ...props } = this.props; return ; } } const NativeBlurView = requireNativeViewManager('ExpoBlurView');