Skip to content

Commit 741dc3b

Browse files
authored
Just throw
1 parent 2a8c4a5 commit 741dc3b

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

content/docs/hooks-reference.md

+1-3
Original file line numberDiff line numberDiff line change
@@ -246,9 +246,7 @@ function reducer(state, action) {
246246
case 'reset':
247247
return init(action.payload);
248248
default:
249-
// A reducer must always return a valid state.
250-
// Alternatively you can throw an error if an invalid action is dispatched.
251-
return state;
249+
throw new Error();
252250
}
253251
}
254252

0 commit comments

Comments
 (0)