DEV Community

Discussion on: An Introduction to React useReducer Hook

Collapse
 
nibble profile image
Joseph Mawa • Edited

Nicely written article. It got me thinking about the following though.

  1. What exactly happens in the Component when a default case throws in case of a non existent action type (when a dispatched action doesn't have a corresponding case)?
  2. Must the action parameter always be an object? Can't I do something like ["SET_WHATEVER", 2] and handle it accordingly in the reducer?