To change the behavior of the form, we need to add an event handler to the submit button.
The event handler will prevent the default behavior of the button, and log the values of the inputs.
<button onClick={handleSubmit}>Add</button>
function handleSubmit(event) {
event.preventDefault();
console.log(name);
}