Skip to content
This repository has been archived by the owner on Jan 29, 2024. It is now read-only.

Commit

Permalink
Fix example in README
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesplease committed Feb 13, 2019
1 parent 79cdc14 commit e0fd85a
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions README.md
Expand Up @@ -126,12 +126,9 @@ the state as you would using a React Component's `setState`:
export function createTodo(newTodo) {
return function(setState) {
setState(prevState => {
// Shallow clone our todos, so that we do not modify the state
const clonedTodos = [...prevState.todos];

return {
todos: clonedTodos.push(newTodo),
};
todos: prevState.todos.concat([newTodo])
);
});
};
}
Expand Down

0 comments on commit e0fd85a

Please sign in to comment.