Skip to content

Instantly share code, notes, and snippets.

@hgale
Created February 26, 2017 22:52
Show Gist options
  • Save hgale/952a7117f4e391eaad650aa486b942fe to your computer and use it in GitHub Desktop.
Save hgale/952a7117f4e391eaad650aa486b942fe to your computer and use it in GitHub Desktop.
import React from 'react'
import { ListView } from 'react-native'
import { FlickrImages } from './FlickrImages'
import ImageRow from './ImageRow'
import { BgView } from './Background'
import style from './Style'
class HomeScreen extends React.Component {
constructor(props) {
super(props)
const ds = new ListView.DataSource({rowHasChanged: (r1, r2) => r1.uri !== r2.uri})
this.state = {
dataSource: ds.cloneWithRows(FlickrImages)
}
}
render() {
return (
<BgView>
<ListView
contentContainerStyle={{justifyContent: 'center'}}
dataSource={this.state.dataSource}
renderRow={(rowData) => <ImageRow {...rowData} />}
/>
</BgView>
)
}
}
export default HomeScreen
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment