Quantcast
Channel: Active questions tagged react-native+typescript - Stack Overflow
Viewing all articles
Browse latest Browse all 6288

React Native | How access to endCoordinates of Keyboard using Typescript and recompose

$
0
0

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.


Viewing all articles
Browse latest Browse all 6288

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>