[FlatList] ItemSeparatorComponent bug.
See original GitHub issueDescription
When I set horizontal true for FlatList, ItemSeparatorComponent is added vertically.
Sample Code
import React, { Component } from 'react';
import {
AppRegistry,
StyleSheet,
Text,
View,
FlatList
} from 'react-native';
export default class flatlist_bug extends Component {
constructor() {
super();
const arr = [];
for(let i=0; i<100; i++)
arr.push({key: i, value: i});
this.state = {data: arr};
}
render() {
return (
<View style={ styles.container }>
<FlatList style={{marginTop: 100, paddingHorizontal:30, backgroundColor:'yellow', height:20}}
horizontal
ItemSeparatorComponent={ () => <View style={ { width: 10, height: 10, backgroundColor: 'red' } } /> }
data={ this.state.data }
renderItem={ (rowData) => <Text style={{backgroundColor:'blue'}} >{ rowData.item.value }</Text> }
/>
</View>
);
}
}
const styles = StyleSheet.create({
container: {
flex: 1,
justifyContent: 'center',
alignItems: 'center',
backgroundColor: '#F5FCFF',
},
welcome: {
fontSize: 20,
textAlign: 'center',
margin: 10,
},
instructions: {
textAlign: 'center',
color: '#333333',
marginBottom: 5,
},
});
Additional Information
- React Native version: 0.45.1
- React: 16.0.0-alpha.12
- Platform: ios. not checked android.
- Development Operating System: macOS
Issue Analytics
- State:
- Created 6 years ago
- Reactions:5
- Comments:7 (3 by maintainers)
Top Results From Across the Web
[BUG] FlatList ItemSeparatorComponent not work correctly.
Description When I set horizontal true for FlatList, ItemSeparatorComponent is added vertically. Please fix this bug.
Read more >What cause glitching in FlatList in React Native?
For a while, it goes well, loads the pages perfectly but after a few pages, it starts to glitching and sometimes disappear.
Read more >FlatList - React Native Archive
A performant interface for rendering basic, flat lists, supporting the most handy features: Fully cross-platform. Optional horizontal mode.
Read more >Features of React Native FlatList - eduCBA
React native flatlist is like a listview which is used to hold items in a list and provide important features like scrolling horizontally...
Read more >React Native FlatList Component - GeeksforGeeks
Props in FlatList: renderItem: It is used to render the data into the list. data: It is basically an array of data. ItemSeparatorComponent:...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
same here, its happen after update RN to 45.0.1
That also happen to me: Android Emulator Windows “react”: “16.0.0-alpha.12”, “react-native”: “0.48.3”,