- accepted / - tried
It is quite common to see switches and checkboxes in web apps.
Implement useToggle() to make things easier
useToggle()
function App() { const [on, toggle] = useToggle() ...}
Bugfree ordinary solution is better than buggy fancy ones.
Try it out
Console