From 8bceeef801a4c5c6abee0a3bf7257fe6a6e430ac Mon Sep 17 00:00:00 2001 From: Bruno Scopelliti Date: Thu, 22 Aug 2019 12:18:44 +0200 Subject: [PATCH] Only warn in case the fourth argument is a function --- packages/react-reconciler/src/ReactFiberHooks.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/react-reconciler/src/ReactFiberHooks.js b/packages/react-reconciler/src/ReactFiberHooks.js index 90b7d82eef56b..5c36e6407032b 100644 --- a/packages/react-reconciler/src/ReactFiberHooks.js +++ b/packages/react-reconciler/src/ReactFiberHooks.js @@ -1122,7 +1122,7 @@ function dispatchAction( if (__DEV__) { warning( - arguments.length <= 3, + typeof arguments[3] !== 'function', "State updates from the useState() and useReducer() Hooks don't support the " + 'second callback argument. To execute a side effect after ' + 'rendering, declare it in the component body with useEffect().',