Created
June 16, 2017 14:44
-
-
Save bartolkaruza/87ef49d1b2d0227782739584b110722b to your computer and use it in GitHub Desktop.
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
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