Skip to content

Commit

Permalink
feat: replace lodash isEqual
Browse files Browse the repository at this point in the history
  • Loading branch information
wangxingkang committed Jan 24, 2024
1 parent e3849b3 commit 4e09144
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/hooks/usePropsReactive.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { isEqual } from 'lodash-es';
import { isFunction } from '@pansy/shared';
import { useDeepCompareEffect, useUnmount, usePrevious } from '@pansy/react-hooks';
import { toCapitalString } from '../utils/toCapitalString';
import { deepEqual } from '../utils/deepEqual';

interface Options {
setterMap?: Record<string, Function>;
Expand Down Expand Up @@ -46,7 +46,7 @@ export function usePropsReactive<

let willReactive = true;
if (shouldDetectChange) {
willReactive = !isEqual(nextProps[key], prevProps?.[key]);
willReactive = !deepEqual(nextProps[key], prevProps?.[key]);
}
if (!willReactive) return;

Expand Down

0 comments on commit 4e09144

Please sign in to comment.