Skip to content

Instantly share code, notes, and snippets.

@bartolkaruza
Created June 16, 2017 14:44
Show Gist options
  • Save bartolkaruza/87ef49d1b2d0227782739584b110722b to your computer and use it in GitHub Desktop.
Save bartolkaruza/87ef49d1b2d0227782739584b110722b to your computer and use it in GitHub Desktop.
import React, {Component} from 'react';
import {
AppRegistry,
StyleSheet,
Text,
View,
FlatList
} from 'react-native';
export default class FlatListInverted extends Component {
render() {
const data = [
{text: 'hi', num: 1},
{text: 'hi', num: 2},
{text: 'hi', num: 3},
{text: 'hi', num: 4},
{text: 'hi', num: 5},
{text: 'hi', num: 6},
{text: 'hi', num: 7}
];
return (
<FlatList
data={data}
inverted={true}
renderItem={item => (
<View key={item.index}>
<Text>{item.item.text} : {item.item.num}</Text>
</View>
)}
/>
);
}
}
AppRegistry.registerComponent('FlatListInverted', () => FlatListInverted);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment