npm i @reactuses/core
Collection of essential React Hooks Utilities.
import { useToggle } from '@reactuses/core'
function Demo() {
const [on, toggle] = useToggle(true)
return (
<div>
<div>{on ? 'ON' : 'OFF'}</div>
<button onClick={toggle}>Toggle</button>
<button onClick={() => toggle(true)}>set ON</button>
<button onClick={() => toggle(false)}>set OFF</button>
</div>
)
}
Refer to documentations for more details.
You can submit an issue or provide feedback on Discord.
See the Contributing Guide
See the ChangeLog
This project is heavily inspired by the following awesome projects.
If my work has helped you, consider buying me a cup of coffee. Thank you very much🥰!.