Skip to content

Instantly share code, notes, and snippets.

@callmephilip
Last active October 20, 2016 11:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save callmephilip/c88f2616074050d0724525a39ee2c668 to your computer and use it in GitHub Desktop.
Save callmephilip/c88f2616074050d0724525a39ee2c668 to your computer and use it in GitHub Desktop.
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