We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8d2fe35 commit a940494Copy full SHA for a940494
src/PickerInput/hooks/useDelayState.ts
@@ -1,4 +1,4 @@
1
-import { useEvent, useMergedState } from '@rc-component/util';
+import { useEvent, useControlledState } from '@rc-component/util';
2
import raf from '@rc-component/util/lib/raf';
3
import React from 'react';
4
@@ -11,7 +11,7 @@ export default function useDelayState<T>(
11
defaultValue?: T,
12
onChange?: (next: T) => void,
13
): [state: T, setState: (nextState: T, immediately?: boolean) => void] {
14
- const [state, setState] = useMergedState<T>(defaultValue, { value });
+ const [state, setState] = useControlledState<T>(defaultValue, value);
15
16
const nextValueRef = React.useRef<T>(value);
17
0 commit comments