State Management · Junior · Question 12 of 75

What does a reducer usually return for an unknown action type?

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.

Further reading

Problem with a question

State Management · Junior · question 12

Test yourself

Take the State Management · Junior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz