I am trying flexGrow with FlatList but it is not working as it works with ListView. The items are getting rendered with minWidth value even if space is there on the screen. Sample code :
class ProductListScreen extends Component {
render () {
return (<FlatList
contentContainerStyle={styles.list}
showsVerticalScrollIndicator={false}
data={[{key: 'a'}, {key: 'b'},{key: 'c'},{key: 'd'}, {key: 'e'},{key: 'f'},{key: 'g'}, {key: 'h'},{key: 'i'},{key: 'j'}]}
renderItem={this.renderItem}
/>);
renderItem({ item, index }) {
return <View style={{
flexGrow: 1,
margin: 5,
minWidth: 154,
maxWidth: 223,
height: 304,
maxHeight:304,
backgroundColor: '#CCC',
}}/>;
}
}
var styles = StyleSheet.create({
list: {
justifyContent: 'center',
flexDirection: 'row',
flexWrap: 'wrap'
})