Nicely written article. It got me thinking about the following though.
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)?
Must the action parameter always be an object? Can't I do something like ["SET_WHATEVER", 2] and handle it accordingly in the reducer?
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Nicely written article. It got me thinking about the following though.
default
case throws in case of a non existent action type (when a dispatched action doesn't have a corresponding case)?["SET_WHATEVER", 2]
and handle it accordingly in the reducer?