Validation that returns additional data
I have a validation that returns additional data and I'm not sure where to put it best.
I collect an Address: (Street, PostalCode, City) - I run basic validations against it
Multiple Adresses => Invalid => user needs to select one of them
No Adress => Invalid => user needs to enter a different address
1 Match => Valid => remember the
Where would you put the id? into the form as a hidden input? into a useState? …?
I collect an Address: (Street, PostalCode, City) - I run basic validations against it
onChange (fields are required)onSubmit I run the onSubmitAsync validator on the FormApi - this makes a call against the Backend and returns an array of possible address matches for what the user entered.Multiple Adresses => Invalid => user needs to select one of them
No Adress => Invalid => user needs to enter a different address
1 Match => Valid => remember the
id as it's needed in onSubmit to pass it on to the following processWhere would you put the id? into the form as a hidden input? into a useState? …?