Skip to content

Commit 0dc2731

Browse files
EmilyyyLiu刘欢
andauthored
refactor: Upgrade utils and replace useMergedState (#271)
Co-authored-by: 刘欢 <lh01217311@antgroup.com>
1 parent 01944ce commit 0dc2731

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
},
4747
"dependencies": {
4848
"@ant-design/fast-color": "^3.0.0",
49-
"@rc-component/util": "^1.2.1",
49+
"@rc-component/util": "^1.3.0",
5050
"classnames": "^2.2.6"
5151
},
5252
"devDependencies": {

src/hooks/useColorState.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { useMergedState } from '@rc-component/util';
1+
import { useControlledState } from '@rc-component/util';
22
import { useMemo } from 'react';
33
import type { Color } from '../color';
44
import type { ColorGenInput } from '../interface';
@@ -10,7 +10,7 @@ const useColorState = (
1010
defaultValue: ColorValue,
1111
value?: ColorValue,
1212
): [Color, React.Dispatch<React.SetStateAction<Color>>] => {
13-
const [mergedValue, setValue] = useMergedState(defaultValue, { value });
13+
const [mergedValue, setValue] = useControlledState(defaultValue, value);
1414

1515
const color = useMemo(() => generateColor(mergedValue), [mergedValue]);
1616

0 commit comments

Comments
 (0)