I am trying to use the KeyboardAvoidingView with behavior="padding".
For some reason, when I
I think the best approach is to create a HOC for this, in addition ,by using getBottomSpace from react-native-iphone-x-helper you can solve overlapping issue for IPhone X and..
import React, { ComponentType, ReactNode } from 'react';
import { Platform, KeyboardAvoidingView, View, Pressable, Keyboard } from
'react-native';
import { getBottomSpace } from 'react-native-iphone-x-helper';
interface IProps {
children: ReactNode;
}
const KeyboardAvoidingViewHoc = (Component: ComponentType) => {
return ({ children, ...props }: IProps) => {
return (
{children}
);
};
};
export const AvoidKeyboardAvoidingViewHoc = KeyboardAvoidingViewHoc(View);