diff --git a/package.json b/package.json index ea5dea81c..15acf7bc5 100644 --- a/package.json +++ b/package.json @@ -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", @@ -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", diff --git a/src/Slider.tsx b/src/Slider.tsx index 095053399..00b9f7004 100644 --- a/src/Slider.tsx +++ b/src/Slider.tsx @@ -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'; @@ -269,7 +269,7 @@ const Slider = React.forwardRef((props: SliderProps, ref: React.Ref) 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)); }