From 741dc3b5f1b83b793b725edec2b1ef88c9181c44 Mon Sep 17 00:00:00 2001 From: Dan Abramov Date: Fri, 8 Feb 2019 20:16:30 +0000 Subject: [PATCH] Just throw --- content/docs/hooks-reference.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/content/docs/hooks-reference.md b/content/docs/hooks-reference.md index 90091d8d..7a3a0dde 100644 --- a/content/docs/hooks-reference.md +++ b/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(); } }