State Management · Junior · Question 12 of 75
What does a reducer usually return for an unknown action type?
- ✓Correct answer: Throw an error (or return the current state) so the typo isn't silently ignored
- 2
undefined, which tells React to reset the state - 3An empty object
{}
Explanation
Returning undefined would break the state. The React docs throw an error in default so typos in action types surface immediately; in TypeScript, a discriminated union of actions plus a never check catches them at compile time.