1.2.4 • Published 3 years ago

@build-own-hooks/use-toggle v1.2.4

Weekly downloads
-
License
ISC
Repository
github
Last release
3 years ago

react-use-toggle

A hook to toggle state between true and false.

Demo

DEMO - useToggle Plus

Install

npm i @build-own-hooks/use-toggle

Usage

import useToggle from "@build-own-hooks/use-toggle"

function App() {
  const { isOn, toggle, toggleOn, toggleOff } = useToggle({
    defaultState, onOn, onOff  //optional
  })

  return (
    <div>
      {isOn && "ON"}
      <button onClick={() => toggle}>toggle!</button>
    </div>
  )
}
1.2.4

3 years ago

1.2.3

3 years ago

1.2.2

3 years ago

1.2.1

3 years ago

1.2.0

3 years ago

1.1.3

3 years ago

1.1.2

3 years ago

1.1.1

3 years ago

1.1.0

3 years ago

1.0.9

3 years ago

1.0.8

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago