diff --git a/src/exercise/06.js b/src/exercise/06.js index c8d3ac1c2..005663c90 100644 --- a/src/exercise/06.js +++ b/src/exercise/06.js @@ -18,11 +18,23 @@ function UsernameForm({onSubmitUsername}) { // 🐨 make sure to associate the label to the input. // to do so, set the value of 'htmlFor' prop of the label to the id of input + const [username, setUsername] = React.useState(null); + + const handleSubmit = (event) => { + onSubmitUsername(username); + + event.preventDefault(); + }; + const handleChange = (event) => { + const value = event.target.value.toLowerCase(); + setUsername(value); + }; + return ( -