diff --git a/src/factory/createReducer.ts b/src/factory/createReducer.ts index ef2af42efc..8489d9548a 100644 --- a/src/factory/createReducer.ts +++ b/src/factory/createReducer.ts @@ -1,7 +1,7 @@ import { MutableRefObject, useCallback, useRef, useState } from 'react'; import useUpdateEffect from '../useUpdateEffect'; -type Dispatch = (action: Action) => void; +type Dispatch = (action: Action) => Action; interface Store { getState: () => State; diff --git a/src/useDeepCompareEffect.ts b/src/useDeepCompareEffect.ts index 14c08c4ff0..f08c92228a 100644 --- a/src/useDeepCompareEffect.ts +++ b/src/useDeepCompareEffect.ts @@ -2,8 +2,6 @@ import { DependencyList, EffectCallback } from 'react'; import useCustomCompareEffect from './useCustomCompareEffect'; import isDeepEqual from './misc/isDeepEqual'; -const isPrimitive = (val: any) => val !== Object(val); - const useDeepCompareEffect = (effect: EffectCallback, deps: DependencyList) => { if (process.env.NODE_ENV !== 'production') { if (!(deps instanceof Array) || !deps.length) { @@ -11,12 +9,6 @@ const useDeepCompareEffect = (effect: EffectCallback, deps: DependencyList) => { '`useDeepCompareEffect` should not be used with no dependencies. Use React.useEffect instead.' ); } - - if (deps.every(isPrimitive)) { - console.warn( - '`useDeepCompareEffect` should not be used with dependencies that are all primitive values. Use React.useEffect instead.' - ); - } } useCustomCompareEffect(effect, deps, isDeepEqual);