Skip to content

Instantly share code, notes, and snippets.

@aloukissas
Created January 8, 2019 06:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aloukissas/009caf4f8da306e0b661ab4f6a147cfd to your computer and use it in GitHub Desktop.
Save aloukissas/009caf4f8da306e0b661ab4f6a147cfd to your computer and use it in GitHub Desktop.
import React from "react";
import { Text, View, FlatList } from "react-native";
export default class FlatListDemo extends React.Component {
state = {
data: [0, 1, 2, 3, 4]
};
render() {
return (
<View>
<FlatList
data={this.state.data}
renderItem={({ item }) => <Text>{`item ${item}`}</Text>}
/>
</View>
);
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment