Created
February 26, 2017 22:52
-
-
Save hgale/527ed01ecd5e90bdd0945d8043e4416e 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 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