@uspk-ui/react-use-boolean
Version:
A Quick description of the component
14 lines (12 loc) • 370 B
TypeScript
declare type InitialState = boolean | (() => boolean);
/**
* React hook to manage boolean (on - off) states
*
* @param initialState the initial boolean state value
*/
declare function useBoolean(initialState?: InitialState): readonly [boolean, {
readonly on: () => void;
readonly off: () => void;
readonly toggle: () => void;
}];
export { useBoolean };