mirror of
https://github.com/zebrajr/react.git
synced 2026-01-15 12:15:22 +00:00
Only warn in case the fourth argument is a function (#16543)
This commit is contained in:
committed by
Dan Abramov
parent
05f5192e81
commit
16c3408638
@@ -1122,7 +1122,7 @@ function dispatchAction<S, A>(
|
||||
|
||||
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().',
|
||||
|
||||
Reference in New Issue
Block a user