React
Introduction to React Hooks - useEffect()

Code Dive with useEffect()

Mute
Current Time 0:00
/
Duration Time 0:00
Loaded: 0%
Progress: 0%
Stream TypeLIVE
Remaining Time -0:00
 
PRO

Your turn to dig into the code and implement useEffect()!

For this challenge, do the following:

1️⃣ After the user types a nickname, the showDashboard property should be set to true after 2000ms to give the user time to type

  • If the nickname is blank, showDashboard should be set to false right away to keep the user from seeing an empty welcom message

  • This effect should be called every time the nickname changes, so the nickname is a dependency of the effect

2️⃣ For the other effect, generate a new temperature, but only one time when the page loads.

You can work on the challenge on StackBlitz. Check out the hints file if you get stuck.

 

I finished! On to the next chapter