UNPKG

465 BTypeScriptView Raw
1type Updater<T> = (updater: T | ((origin: T) => T), ignoreDestroy?: boolean) => void;
2/**
3 * Similar to `useState` but will use props value if provided.
4 * Note that internal use rc-util `useState` hook.
5 */
6export default function useMergedState<T, R = T>(defaultStateValue: T | (() => T), option?: {
7 defaultValue?: T | (() => T);
8 value?: T;
9 onChange?: (value: T, prevValue: T) => void;
10 postState?: (value: T) => T;
11}): [R, Updater<T>];
12export {};