Skip to content

Commit 8636df8

Browse files
janhenrikoverlandtimdorr
authored andcommitted
Update ExampleTodoList.md (reduxjs#1852)
Calling todo(undefined, action) does not work without the default state value.
1 parent 728432c commit 8636df8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

docs/basics/ExampleTodoList.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ export const toggleTodo = (id) => {
5858
#### `reducers/todos.js`
5959

6060
```js
61-
const todo = (state, action) => {
61+
const todo = (state = {}, action) => {
6262
switch (action.type) {
6363
case 'ADD_TODO':
6464
return {

0 commit comments

Comments
 (0)