Created
June 11, 2016 23:23
-
-
Save talkol/b2d9e1e3df9e00bd8aa3b64e51d3c21a 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 { Text, View, Dimensions } from 'react-native'; | |
import RecyclingListView from './RecyclingListView'; | |
const ROWS_IN_DATA_SOURCE = 3000; | |
const dataSource = []; | |
for (let i=0; i<ROWS_IN_DATA_SOURCE; i++) dataSource.push(`This is the data for row # ${i+1}`); | |
export default class RecyclingExample extends Component { | |
render() { | |
return ( | |
<View style={{flex: 1, paddingTop: 20,}}> | |
<RecyclingListView | |
renderRow={this.renderRow} | |
numRows={dataSource.length} | |
rowHeight={50} | |
/> | |
</View> | |
); | |
} | |
renderRow(rowID) { | |
return ( | |
<Text style={{ | |
width: Dimensions.get('window').width, | |
height: 50, | |
backgroundColor: '#ffffff' | |
}}>{dataSource[rowID]}</Text> | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment