Register Fields

Each field needs a specific unique name that you will also use for labels and then you will pass the register Hook to the ref element.

Inside it, you will pass multiple parameters. Required is needed to tell if the user has to enter that field and then you will be able to easily use other standard HTML rules.

Here’s the list of validation rules supported:

required

min

max

minLength

maxLength

pattern

validate

The validate function is a great way to use custom logic specific to that field, enabling you to implement custom behavior very easily.