### Install pods for iOS Source: https://mateusz1913.github.io/react-native-avoid-softinput/docs/guides Run this command after installing the library to link native dependencies on iOS. ```bash npx pod-install ``` -------------------------------- ### Mock Implementation in Jest Setup File Source: https://mateusz1913.github.io/react-native-avoid-softinput/docs/guides/jest-mock-usage Add this code to your Jest setup file to mock the library. This approach allows for overriding mock functions directly within the setup. ```javascript jest.mock('react-native-avoid-softinput', () => { const mock = require('react-native-avoid-softinput/jest/mock'); /** * If needed, override mock like so: * * return Object.assign(mock, { useSoftInputState: jest.fn(() => ({ isSoftInputShown: true, softInputHeight: 300 })) }); */ return mock; }); ``` -------------------------------- ### Install react-native-avoid-softinput with npm Source: https://mateusz1913.github.io/react-native-avoid-softinput/docs/guides Use this command to add the library to your project using npm. ```bash npm i --save react-native-avoid-softinput ``` -------------------------------- ### Install react-native-avoid-softinput with Yarn Source: https://mateusz1913.github.io/react-native-avoid-softinput/docs/guides Use this command to add the library to your project using Yarn. ```bash yarn add react-native-avoid-softinput ``` -------------------------------- ### Sticky Footer Example with useSoftInputHeightChanged Source: https://mateusz1913.github.io/react-native-avoid-softinput/docs/recipes/recipes-sticky-footer Use this hook to apply padding to a container based on the soft input (keyboard) height. This is useful for keeping elements like footers visible when the keyboard is active. Ensure `react-native-safe-area-context` is installed for proper edge handling. ```typescript import { useFocusEffect } from '@react-navigation/native'; import * as React from 'react'; import { ScrollView, StyleSheet, View } from 'react-native'; import { useSoftInputHeightChanged } from 'react-native-avoid-softinput'; import Animated, { useAnimatedStyle, useSharedValue, withTiming } from 'react-native-reanimated'; import { SafeAreaView } from 'react-native-safe-area-context'; import Button from '../components/Button'; import SingleInput from '../components/SingleInput'; import { styles as commonStyles } from '../consts/styles'; const NOOP = () => {}; export const StickyFooterExample: React.FC = () => { const buttonContainerPaddingValue = useSharedValue(0); const buttonContainerAnimatedStyle = useAnimatedStyle(() => { return { paddingBottom: buttonContainerPaddingValue.value, }; }); /** * You can also use `useSoftInputShown` & `useSoftInputHidden` * * useSoftInputShown(({ softInputHeight }) => { * buttonContainerPaddingValue.value = withTiming(softInputHeight); * }); * * useSoftInputHidden(() => { * buttonContainerPaddingValue.value = withTiming(0); * }); */ useSoftInputHeightChanged(({ softInputHeight }) => { buttonContainerPaddingValue.value = withTiming(softInputHeight); }); return