0.4.1 • Published 5 years ago
@jmdc-rehooks/use-bool v0.4.1
Install
$ yarn add @jmdc-rehooks/use-bool
Usage
import useBool = '@jmdc-rehooks/use-bool';
const TestComponent = () => {
const [state, turnOn, turnOff] = useBool(false)
return (
<div>
<span>{state ? 'on' : 'off'}</span>
<button onClick={turnOn}></button>
<button onClick={turnOff}></button>
</div>
)
}