Skip to content

Instantly share code, notes, and snippets.

@NarekChang
Created April 23, 2019 11:19
Show Gist options
  • Save NarekChang/af63d5fb3a381c9c00ac6dbb95f34875 to your computer and use it in GitHub Desktop.
Save NarekChang/af63d5fb3a381c9c00ac6dbb95f34875 to your computer and use it in GitHub Desktop.
VirtualizedList Example
<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