So I use recompoose and typescript in my react native app, and I trying to access to endCoordinates for Keyboard the get the Keyboard height. I followed this article and this post but I am not able to access to endCoordinates, it's always undefined.
This is what I tried :
const withLifeCycle = lifecycle<Handlers, {}> ({ componentDidMount() { // @ts-ignore this.keyboardDidShowListener = Keyboard.addListener('keyboardDidShow', this.props._keyboardDidShow)}, componentWillUnmount() { // @ts-ignore this.keyboardDidShowListener.remove(); }}) interface Handlers { _keyboardDidShow: (e:any) => void;}// WrappedProps have some other props for some other part of codesexport const enhance = compose<WrappedProps, Props>(withHandlers<Props,{}>({ _keyboardDidShow: (e) => () =>{ console.log(e.endCoordinates) // This is Undefined } }), withLifeCycle);
I think the problem is the way I need to pass the keyboardDidShow event type to the method, because e
object does not have any endCoordinates
.