import { boundMethod } from 'autobind-decorator' ; import * as React from 'react' ; import { GestureResponderEvent , Keyboard , View , ViewProperties , } from 'react-native' ; export class DismissKeyboardView extends React . Component < ViewProperties > { @ boundMethod private onStartShouldSetResponder ( ) { return true ; } @ boundMethod private onMoveShouldSetResponder ( ) { return false ; } @ boundMethod private onResponderRelease ( event ) { Keyboard . dismiss ( ) ; console . log ( event . nativeEvent . touches ) ; if ( typeof this . props . onResponderRelease !== 'undefined' ) { this . props . onResponderRelease ( event ) ; } } public render ( ) { return ( < View { ... this . props } onStartShouldSetResponder = { this . onStartShouldSetResponder } onMoveShouldSetResponder = { this . onMoveShouldSetResponder } onResponderRelease = { this . onResponderRelease } > { this . props . children } < /View>); } }