Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/calvein/use-toggle

React hook for toggling things
https://github.com/calvein/use-toggle

hooks react

Last synced: about 2 months ago
JSON representation

React hook for toggling things

Awesome Lists containing this project

README

        

# `@calvein/use-toggle`

> React hook for toggling

## Install

```sh
npm install @calvein/use-toggle
```

## Usage

```js
import useToggle from '@calvein/use-toggle';

const MyComponent = () => {
const { isOn, isOff, on, off, toggle } = useToggle();

return (

is {isOn ? 'on' : 'off'}

);
}
```