Coding Challenge Practice – Question 12



This content originally appeared on DEV Community and was authored by Bukunmi Odugbesan

Today’s task is to implement a useToggle hook. The boilerplate function is


export function useToggle(on: boolean): [boolean, () => void] {
  // your code here
}


// if you want to try your code on the right panel
// remember to export App() component like below

// export function App() {
//   return <div>your app</div>
// }


This content originally appeared on DEV Community and was authored by Bukunmi Odugbesan