@patomation/usetoggle

1.2.0 • Public • Published

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>
  )

}

/@patomation/usetoggle/

    Package Sidebar

    Install

    npm i @patomation/usetoggle

    Weekly Downloads

    5

    Version

    1.2.0

    License

    ISC

    Unpacked Size

    3.05 kB

    Total Files

    5

    Last publish

    Collaborators

    • patomation