Active doors

  • React
  • Exercises
  • Active doors

React exercise number 4

  • JSX
  • useState

Active doors

Let's build a simple app that shows us which door is active using React!

Quick start

Start with this code as a boilerplate for the exercise.


Step 1

Use the useState hook to keep the state of the active door.

Step 2

Show on some text which door is active depending on the state.

Step 3

Modify the background color of the li element of the active door.

Step 4

Implement a reset button which when clicked, eliminates the active door, returning the text to "Active door: none".