APSL / react-native-keyboard-aware-scroll-view

A ScrollView component that handles keyboard appearance and automatically scrolls to focused TextInput.
MIT License
5.27k stars 646 forks source link

Add Typescript definitions for listenToKeyboardEvents #399

Open leonid-shevtsov opened 4 years ago

leonid-shevtsov commented 4 years ago

It's great that this package ships with TS definitions, but the function was missing from them.

It's tricky to properly type a HOC that returns a component with an API; but I found a way that works.

One inconvenience is that with a curried HOC Typescript cannot infer the types of the props, and you would have to define them explicitly:

listenToKeyboardEvents<ScrollViewProps>(options)(ScrollView)
anthowm commented 3 years ago

Could we merge this one for fix type issues ?

pelayomartinez commented 2 years ago

Would also love to see this merged!