@uplift-ltd/use-keyboard-visible
v2.0.0
Published
use-keyboard-visible
Downloads
4
Readme
@uplift-ltd/use-keyboard-visible
Installation
npm i --save @uplift-ltd/use-keyboard-visible
API
useKeyboardVisible
Hook for react-native keyboard visibility.
import { useKeyboardVisible } from "@uplift-ltd/use-keyboard-visible";
function MyComponent() {
const keyboardVisible = useKeyboardVisible();
}
Defaults to using keyboardWillShow
and keyboardWillHide
events. Can pass in keyboardDidShow
and keyboardDidHide
instead.
import {
useKeyboardVisible,
KeyboardShowEvents,
KeyboardHideEvents,
} from "@uplift-ltd/use-keyboard-visible";
function MyComponent() {
const keyboardVisible = useKeyboardVisible({
showEvent: KeyboardShowEvents.keyboardDidShow,
hideEvent: KeyboardHideEvents.keyboardDidHide,
});
}