Dan Abramov
6 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
1 additions and
3 deletions
-
content/docs/hooks-reference.md
|
|
@ -246,9 +246,7 @@ function reducer(state, action) { |
|
|
|
case 'reset': |
|
|
|
return init(action.payload); |
|
|
|
default: |
|
|
|
// A reducer must always return a valid state. |
|
|
|
// Alternatively you can throw an error if an invalid action is dispatched. |
|
|
|
return state; |
|
|
|
throw new Error(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|