Commit 2808841a authored by Pascal Hartig's avatar Pascal Hartig

Merge pull request #793 from tcoopman/gh-pages

Reactjs: compare through object identity instead of id
parents 0162bf8f e61ff9cb
......@@ -62,7 +62,6 @@
*/
shouldComponentUpdate: function (nextProps, nextState) {
return (
nextProps.todo.id !== this.props.todo.id ||
nextProps.todo !== this.props.todo ||
nextProps.editing !== this.props.editing ||
nextState.editText !== this.state.editText
......
......@@ -61,7 +61,7 @@
window.TodoModel.prototype.destroy = function (todo) {
this.todos = this.todos.filter(function (candidate) {
return candidate.id !== todo.id;
return candidate !== todo;
});
this.inform();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment