Skip to content

Commit 1766105

Browse files
committed
Not sure why it ever said state.actions, that wasn't the intention
1 parent 78b84fd commit 1766105

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

docs/Troubleshooting.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,14 @@ For example, a reducer like this is wrong because it mutates the state:
2121
function todos(state = [], action) {
2222
switch (action.type) {
2323
case 'ADD_TODO':
24-
// Wrong! This mutates state.actions.
25-
state.actions.push({
24+
// Wrong! This mutates state
25+
state.push({
2626
text: action.text,
2727
completed: false
2828
});
2929
case 'COMPLETE_TODO':
30-
// Wrong! This mutates state.actions[action.index].
31-
state.actions[action.index].completed = true;
30+
// Wrong! This mutates state[action.index].
31+
state[action.index].completed = true;
3232
}
3333

3434
return state;

0 commit comments

Comments
 (0)