Skip to content

Commit

Permalink
feat: remove shadowequal (#857)
Browse files Browse the repository at this point in the history
  • Loading branch information
yoyo837 authored Dec 27, 2022
1 parent ff37691 commit fadb6c0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
4 changes: 1 addition & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,7 @@
"dependencies": {
"@babel/runtime": "^7.10.1",
"classnames": "^2.2.5",
"rc-util": "^5.18.1",
"shallowequal": "^1.1.0"
"rc-util": "^5.27.0"
},
"devDependencies": {
"@testing-library/jest-dom": "^5.16.2",
Expand All @@ -61,7 +60,6 @@
"@types/jest": "^26.0.0",
"@types/react": "^16.9.2",
"@types/react-dom": "^16.9.0",
"@types/shallowequal": "^1.1.1",
"@umijs/fabric": "^2.0.0",
"cross-env": "^7.0.0",
"dumi": "^1.1.7",
Expand Down
4 changes: 2 additions & 2 deletions src/Slider.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as React from 'react';
import classNames from 'classnames';
import shallowEqual from 'shallowequal';
import isEqual from 'rc-util/lib/isEqual';
import useMergedState from 'rc-util/lib/hooks/useMergedState';
import type { HandlesRef } from './Handles';
import Handles from './Handles';
Expand Down Expand Up @@ -269,7 +269,7 @@ const Slider = React.forwardRef((props: SliderProps, ref: React.Ref<SliderRef>)
const cloneNextValues = [...nextValues].sort((a, b) => a - b);

// Trigger event if needed
if (onChange && !shallowEqual(cloneNextValues, rawValuesRef.current)) {
if (onChange && !isEqual(cloneNextValues, rawValuesRef.current, true)) {
onChange(getTriggerValue(cloneNextValues));
}

Expand Down

0 comments on commit fadb6c0

Please sign in to comment.