Skip to main content
Version: 7.0.x

useSoftInputShown

useSoftInputShown is a shortcut for using AvoidSoftInput.onSoftInputShown method inside useEffect.

Parameters

TypeRequiredDescription
({ softInputHeight }: { softInputHeight: number }) => voidyesfunction called with current soft input height when soft input is displayed

Example

import { useSoftInputShown } from "react-native-avoid-softinput";

useSoftInputShown(({ softInputHeight }) => {
// Do sth
});