UNPKG

@baseplate-dev/ui-components

Version:

Shared UI component library

6 lines 526 B
/** * Works similarly to `useState`, but allows the state to be controlled and shows a warning if the state is changed from controlled to uncontrolled or vice versa. */ export declare function useControlledState<T>(value: T | undefined, setValue: ((value: T) => void) | undefined): [T | undefined, (value: T) => void]; export declare function useControlledState<T>(value: T | undefined, setValue: ((value: T) => void) | undefined, defaultValue: T): [T, (value: T) => void]; //# sourceMappingURL=use-controlled-state.d.ts.map