react-trip-date
Version:
Accessible, fully customizable date and range picker for React applications.
11 lines • 599 B
TypeScript
import { Dispatch, SetStateAction } from "react";
/**
* Controlled/uncontrolled state helper. If `controlled` is defined the value
* is sourced from the parent each render and `onChange` is invoked when the
* setter is called. Otherwise internal state is used.
*
* The controlled/uncontrolled mode is locked in on mount; switching modes
* after that is unsupported and will warn in development.
*/
export declare function useControlled<T>(controlled: T | undefined, defaultValue: T, onChange?: (value: T) => void): [T, Dispatch<SetStateAction<T>>];
//# sourceMappingURL=useControlled.d.ts.map