Challenge: Build a Controlled Form Component
Task
In this challenge, you will create a Form
component with two input fields: email
and password
. The goal is to use the useRef
hook to reference the input elements and handle form submission logic.
Instructions
- Import the
useRef
hook from thereact
library. - Inside the
Form
component, declare twouseRef
variables:emailRef
andpasswordRef
, initialized withnull
. - Reset the input fields by setting their values to an empty string using the
useRef
variables.
Obrigado pelo seu feedback!