1
ReactAdvanced#hooks#effects
Keep field values in state (or use a form library), validate on change or submit, and show per-field error messages. React Hook Form with a schema validator is the common production choice.
function onSubmit(e) {
e.preventDefault();
if (!email.includes('@')) return setError('Invalid email');
save({ email });
}