BFE.dev
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

What is time & space complexity of your approach?

SolutionAIPosts(154)

Try it out

Console