20
loading...
This website collects cookies to deliver better user experience
import React
in your IDE, the autocomplete would provide something like from ‘react’;
to finish your statement.LoginForm
to match the filename was helpful.<label
, the rest of that line was suggested for me. Knowing that I had a label element for the username and that I was then creating an input element, the AI assistant gave me most of the code for the text input. Afterward, I added the id
attribute myself.id
attribute for me. It’s learning!htmlFor
attribute to link the label to the input for each set of elements. As usual, the autocomplete struggled for me on the first usage for the username, but then when I added it for the password, the suggestion was right there. Magic!handleSubmit
function, I needed to supply the Event object e
myself. But after I typed e.pre
, the model knew I wanted to call e.preventDefault();
. Then, when I needed to add this event handler to the form’s onSubmit
method, the model knew exactly what I wanted to do.useState
hook myself. But when I followed the same pattern again for the password, the AI assistant was right by my side and ready with the code I needed.