Browse Source

Just throw

main
Dan Abramov 6 years ago
committed by GitHub
parent
commit
741dc3b5f1
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      content/docs/hooks-reference.md

4
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();
}
}

Loading…
Cancel
Save