import useCustomCompareEffect from './useCustomCompareEffect'; import isDeepEqual from './misc/isDeepEqual'; var isPrimitive = function (val) { return val !== Object(val); }; var useDeepCompareEffect = function (effect, deps) { if (process.env.NODE_ENV !== 'production') { if (!(deps instanceof Array) || !deps.length) { console.warn('`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); }; export default useDeepCompareEffect;