Skip to content

Commit 16c3408

Browse files
Bruno Scopellitigaearon
Bruno Scopelliti
authored andcommitted
Only warn in case the fourth argument is a function (#16543)
1 parent 05f5192 commit 16c3408

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/react-reconciler/src/ReactFiberHooks.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1122,7 +1122,7 @@ function dispatchAction<S, A>(
11221122

11231123
if (__DEV__) {
11241124
warning(
1125-
arguments.length <= 3,
1125+
typeof arguments[3] !== 'function',
11261126
"State updates from the useState() and useReducer() Hooks don't support the " +
11271127
'second callback argument. To execute a side effect after ' +
11281128
'rendering, declare it in the component body with useEffect().',

0 commit comments

Comments
 (0)