1.2.4 • Published 2 years ago

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

Weekly downloads
-
License
ISC
Repository
github
Last release
2 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

2 years ago

1.2.3

2 years ago

1.2.2

2 years ago

1.2.1

2 years ago

1.2.0

2 years ago

1.1.3

2 years ago

1.1.2

2 years ago

1.1.1

2 years ago

1.1.0

2 years ago

1.0.9

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago