This project is “semi-maintained” 😅
I don't have the bandwidth right now to look into edge-case issues or help troubleshoot, but I plan on keeping it up-to-date with major React releases, and fixing issues that are both serious and common.
Feel free to create a pull request or issues for features, bug fixes or improvements.
Package can be added using:
Yarn
yarn add easy-hooks-ts
NPM
npm install easy-hooks-ts
PNPM
pnpm install easy-hooks-ts
import { useToggle } from 'easy-hooks-ts'
export const Component = () => {
const [value, toggle, setValue] = useToggle()
const customToggle = () => setValue((x: boolean) => !x)
return (
<>
<p>
Value is <code>{value.toString()}</code>
</p>
<button onClick={() => setValue(true)}>set true</button>
<button onClick={() => setValue(false)}>set false</button>
<button onClick={toggle}>toggle</button>
<button onClick={customToggle}>custom toggle</button>
</>
)
}
Read our contributing guide to learn about our development process, how to propose bugfixes and improvements, and how to build and test your changes to easy-hooks-ts
.