@billogram/use-toggle
A React hook for toggle components
Install
yarn add @billogram/use-toggle
Usage
import useToggle from '@billogram/use-toggle';
See types for exported types.
useToggle
const {
close,
open,
toggle,
value,
} = useToggle({
disabled: false,
initialValue: false,
onOff: noop,
onOn: noop,
shouldRunHandlerOnInitialRender: false,
});
Note
This library is being published with our use cases in mind and is not necessarily meant to be consumed by the broader public. We probably won't take your feature requests unless they align with our own needs.
License
MIT