Skip to content

Instantly share code, notes, and snippets.

@callmephilip

callmephilip/todo.js

Last active Oct 20, 2016
Embed
What would you like to do?
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