The past few weeks have brought a lot of change all over the world. Here at Level Up, we hope you're taking appropriate actions to protect yourself and those around you from the spread of COVID-19. Because many of you are stuck at home, we've put all courses and the yearly subscription (Level Up Pro) 50% off until you unsubscribe.
Stay safe. - Scott Tolinski

Save 50%


*Paid annually

card background pattern
Level 2

Custom React Hooks

Unlock Full Course

$49.99 $24.99



A Basic Toggle Hook

We will start off looking at hooks by making a basic toggle using React hooks. We will use the useState hook to accomplish this.



20 days ago

Scott, what font and theme are you using? Looks great!

2 months ago

@Daniel The intention is to avoid potential bugs when introducing async functionality into the component. Here's a section in the FAQs that gives an example of this:

2 months ago

do you have a link to the recommendation of prevState over the state variable? i couldn't find it in the react docs where they just use the regular state variable

Ryan C. Perry
2 months ago

In the same VSCode package, RAFCE does the same thing with the default export at the bottom.

Something to say?

Become a Pro