Last active
October 20, 2016 11:06
-
-
Save callmephilip/c88f2616074050d0724525a39ee2c668 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
class TodoList extends Component { | |
renderList() { | |
const ds = new ListView.DataSource({ rowHasChanged: (r1, r2) => r1 !== r2, }); | |
return ( | |
<ListView | |
dataSource={ds.cloneWithRows(this.props.todos.toJS())} | |
renderRow={this.renderRow} /> | |
); | |
} | |
renderRow(todo) { | |
return ( | |
<TodoItem todo={todo} /> | |
); | |
} | |
render() { | |
return ( | |
<View style={styles.container}> | |
{this.renderList()} | |
</View> | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment