npm.io
1.2.0 • Published 7 years ago

@patomation/usetoggle

Licence
ISC
Version
1.2.0
Deps
2
Size
3 kB
Vulns
0
Weekly
0

React Hooks use Toggle

Installation:

npm install --save useToggle

or

yarn add useToggle

Usage:

import useToggle from 'useToggle';

const MyComponent = () => {

  const [ value, toggleValue ] = useToggle(false)

  return (
    <button onClick={toggleValue}>
      {value}
    </button>
  )

}

Keywords