Created
April 23, 2019 11:19
-
-
Save NarekChang/af63d5fb3a381c9c00ac6dbb95f34875 to your computer and use it in GitHub Desktop.
VirtualizedList Example
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
<VirtualizedList | |
windowSize={10} | |
data={listArr} | |
style={s.list} | |
contentContainerStyle={s.listContainer} | |
initialNumberToRender={10} | |
renderItem={({ item }) => ( | |
<ExampleComponent /> | |
)} | |
keyExtractor={(item, index) => { | |
return item.key; | |
}} | |
getItem={(listArr, index) => { | |
const item = listArr[index] | |
return { | |
...item, | |
key: `Item${index}${item.id}`, | |
}; | |
}} | |
сolumnWrapperStyle={{ marginBottom: 26 }} | |
numColumns={2} | |
showsVerticalScrollIndicator={false} | |
showsHorizontalScrollIndicator={false} | |
horizontal={false} | |
getItemCount={(data) => data.length} | |
/> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment