Skip to content

Commit

Permalink
Add default case for useReducer form example
Browse files Browse the repository at this point in the history
  • Loading branch information
redrambles committed Oct 6, 2023
1 parent 3cd1723 commit f788a90
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/content/reference/react/useReducer.md
Original file line number Diff line number Diff line change
Expand Up @@ -273,8 +273,10 @@ function reducer(state, action) {
age: state.age
};
}
default: {
throw Error('Unknown action: ' + action.type);
}
}
throw Error('Unknown action: ' + action.type);
}

const initialState = { name: 'Taylor', age: 42 };
Expand Down

0 comments on commit f788a90

Please sign in to comment.