BFE.dev
buy us
a coffee
CompanyListsDiscuss
buy us
a coffee
React Coding Questions7. useToggle()

7. useToggle()

ReactHooks
Share

  - accepted / - tried

It is quite common to see switches and checkboxes in web apps.

Implement useToggle() to make things easier

function App() {
  const [on, toggle] = useToggle()
  ...
}
prevnext

Always try to find a better approach.

(43)

Try it out

Console