Initialize Toggle
Loading "Initialize Toggle"
Run locally for transcripts
π¨βπΌ Our toggle component should be able to be customizable for the initial state
and reset to the initial state.
π§ββοΈ I've updated the toggle component to use a reducer instead of
useState
. If
you'd like to back up, and do that yourself in the playground, by my guest. Or
you can check my work instead.π¨βπΌ Please add a case in our reducer for the
reset
logic, and add an option to
our useToggle
hook for setting the initialOn state.