license import React from 'react' ; import { StyleProp , StyleSheet , View , ViewProps , ViewStyle , } from 'react-native' ; export type PopoverIndicatorProps = ViewProps ; export type PopoverIndicatorElement = React . ReactElement < PopoverIndicatorProps > ; export class PopoverIndicator extends React . Component < PopoverIndicatorProps > { private getComponentStyle = ( source ) => { const flatStyle = StyleSheet . flatten ( source ) ; return { container : { borderLeftWidth : flatStyle . width , borderRightWidth : flatStyle . width , borderBottomWidth : flatStyle . height , borderBottomColor : flatStyle . backgroundColor , borderLeftColor : 'transparent' , borderRightColor : 'transparent' , backgroundColor : 'transparent' , } , } ; } ; public render ( ) { const { style , ... props } = this . props ; const evaStyle = this . getComponentStyle ( style ) ; return ( < View { ... props } style = { [ style , styles . container , evaStyle . container ] } / > ) ; } } const styles = StyleSheet . create ( { container : { } , } ) ;