Skip to content

Instantly share code, notes, and snippets.

@EmmanuelGuther
Last active May 5, 2017 11:01
Show Gist options
  • Save EmmanuelGuther/c52020953825933141139a96b0b006dc to your computer and use it in GitHub Desktop.
Save EmmanuelGuther/c52020953825933141139a96b0b006dc to your computer and use it in GitHub Desktop.
REACT-NATIVE: ListView to the new FlatView
import React from 'react'
import { Text } from 'react-native'
import FlatList from 'react-native/Libraries/Lists/FlatList'
import dataList from './dataList'
export default class ListViewToFlatList extends React.Component {
renderItem ({ item, index }) {
return <Text>{item}</Text>
}
render () {
return (
<FlatList
data={listData}
renderItem={this.renderItem}
/>
)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment