react-toggle-value
TypeScript icon, indicating that this package has built-in type declarations

0.1.1 • Public • Published

useToggleValue

useToggleValue is a custom React hook to toggle value between two given values

Installation

# Using npm.
npm install react-toggle-value

Usage

import  useToggleValue from "react-toggle-value";

const [
  color,
  toggle,
  turnRed,
  turnGreen
 ] = useToggleValue('red', ['red', 'green']);

const [ loading, toggle ] = useToggleValue(false);

Contributing

Please feel free to submit any issues or pull requests.

License

MIT

Readme

Keywords

Package Sidebar

Install

npm i react-toggle-value

Weekly Downloads

0

Version

0.1.1

License

MIT

Unpacked Size

2.96 kB

Total Files

5

Last publish

Collaborators

  • bansal