2.3.0 • Published 2 years ago
sk-use-hooks v2.3.0
QuickStart
import { useToggle } from "sk-use-hooks";
const 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>
);
};
This project is heavily inspired by the following awesome projects.