Skip to content

Instantly share code, notes, and snippets.

@felippepuhle
Created December 29, 2022 11:11
Show Gist options
  • Save felippepuhle/00182092e6cf8fe399fc7872127bfbf0 to your computer and use it in GitHub Desktop.
Save felippepuhle/00182092e6cf8fe399fc7872127bfbf0 to your computer and use it in GitHub Desktop.
import {
KeyboardAvoidingView as RNKeyboardAvoidingView,
KeyboardAvoidingViewProps as RNKeyboardAvoidingViewProps,
Platform,
StyleSheet,
} from 'react-native';
const BEHAVIOR = Platform.OS === 'ios' ? 'padding' : undefined;
const KeyboardAvoidingView = ({ style, ...props }: RNKeyboardAvoidingViewProps) => (
<RNKeyboardAvoidingView style={[styles.container, style]} behavior={BEHAVIOR} {...props} />
);
const styles = StyleSheet.create({
container: {
flex: 1,
},
});
export default KeyboardAvoidingView;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment