
Now that we have a reference to the text entered by the user, we need to add it to state when the save button is clicked. To do this effectively, we need to add an onSubmit event handler to the form element which will be called when the save (submit) button is clicked. This onSubmit handler attribute expects a function which will be executed when the save button is …
In situations where the form you are dealing with is relatively simple and only requires submission of user data with no dynamic UI updates during user input, or input formatting before submission, uncontrolled components could be a better choice.