Menu
Coddy logo textTech

Recap: Forms & Inputs

Part of the Fundamentals section of Coddy's React journey — lesson 32 of 42.

challenge icon

Challenge

Medium

Chapter recap. Build a nickname picker with the full controlled-input loop: type, watch live feedback, clear.

  1. Make the input (id="nick") controlled with nick state, starting empty.
  2. The paragraph (id="meter") shows N of 12 where N is the nickname's current length (e.g. typing Coddy5 of 12), derived, not stored.
  3. The id="clear" button empties the nickname, and the box with it.

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