Menu
Coddy logo textTech

Step 4: Follow Toggle

Part of the Fundamentals section of Coddy's React journey. Lesson 42 of 42.

challenge icon

Challenge

Medium

Complete the profile card.

  1. Add boolean state following (start false) to ProfileCard.
  2. Add a button with id="follow" that flips it on click.
  3. The button's label is Following when true, Follow when false.

Try it yourself

<!DOCTYPE html>
<html>
    <head>
        <link rel="stylesheet" href="styles.css" />
    </head>
    <body>
        <div id="root"></div>
        <script type="module" src="main.jsx"></script>
    </body>
</html>

All lessons in Fundamentals