UNPKG

@leafygreen-ui/hooks

Version:
10 lines 613 B
import { ChangeEventHandler } from 'react'; import { ControlledValueReturnObject } from './useControlledValue.types'; /** * A hook that enables an input component to be both controlled or uncontrolled. * * Returns a {@link ControlledValueReturnObject} with the controlled or uncontrolled `value`, * `onChange` & `onClear` handlers, a `setInternalValue` setter, and a boolean `isControlled` */ export declare const useControlledValue: <T>(controlledValue?: T, changeHandler?: ChangeEventHandler<any> | null, initialValue?: T) => ControlledValueReturnObject<T>; //# sourceMappingURL=useControlledValue.d.ts.map