Skip to content

Commit a940494

Browse files
author
刘欢
committed
feat: replace useMergedState in useDelayState
1 parent 8d2fe35 commit a940494

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/PickerInput/hooks/useDelayState.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { useEvent, useMergedState } from '@rc-component/util';
1+
import { useEvent, useControlledState } from '@rc-component/util';
22
import raf from '@rc-component/util/lib/raf';
33
import React from 'react';
44

@@ -11,7 +11,7 @@ export default function useDelayState<T>(
1111
defaultValue?: T,
1212
onChange?: (next: T) => void,
1313
): [state: T, setState: (nextState: T, immediately?: boolean) => void] {
14-
const [state, setState] = useMergedState<T>(defaultValue, { value });
14+
const [state, setState] = useControlledState<T>(defaultValue, value);
1515

1616
const nextValueRef = React.useRef<T>(value);
1717

0 commit comments

Comments
 (0)