Skip to content
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.



User photo avatar
updated 3 months ago

@fpigeonjr Font is MonoLisa and theme Synthwave 84

User photo avatar
5 months ago

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

User photo avatar
7 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:

7 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
7 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