license import React from 'react' ; import { Insets , StyleSheet , TouchableOpacity , TouchableOpacityProps , ViewStyle , } from 'react-native' ; export interface TouchableWithoutFeedbackProps extends TouchableOpacityProps { useDefaultHitSlop ? : boolean ; children ? : React . ReactNode ; } export type TouchableWithoutFeedbackElement = React . ReactElement < TouchableWithoutFeedbackProps > ; see https export class TouchableWithoutFeedback extends React . Component < TouchableWithoutFeedbackProps > { private createHitSlopInsets = ( ) : Insets => { const flatStyle = StyleSheet . flatten ( this . props . style || { } ) ; const value = 40 - flatStyle . height || 0 ; return { left : value , top : value , right : value , bottom : value , } ; } ; public render ( ) { return ( < TouchableOpacity activeOpacity = { 1.0 } hitSlop = { this . props . useDefaultHitSlop && this . createHitSlopInsets ( ) } { ... this . props } />); } }