Created
March 25, 2020 16:42
-
-
Save tspike/71b716edd4c8c138783e2d1040d8193b to your computer and use it in GitHub Desktop.
<FlatList> nested within <Content> workaround
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 React from 'react'; | |
import {Content} from 'native-base'; | |
import {KeyboardAwareView} from 'react-native-keyboard-aware-view'; | |
import {SafeAreaView} from 'react-native'; | |
class FlatlistContent extends Content { | |
render() { | |
const { | |
children, | |
contentContainerStyle, | |
keyboardShouldPersistTaps, | |
padder, | |
} = this.props; | |
const containerStyle = { | |
flex: 1, | |
}; | |
return ( | |
<SafeAreaView style={containerStyle}> | |
<KeyboardAwareView | |
keyboardShouldPersistTaps={keyboardShouldPersistTaps || 'handled'} | |
style={[{padding: padder}, contentContainerStyle]}> | |
{children} | |
</KeyboardAwareView> | |
</SafeAreaView> | |
); | |
} | |
} | |
export default FlatlistContent; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment