Created
December 29, 2022 11:11
-
-
Save felippepuhle/00182092e6cf8fe399fc7872127bfbf0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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