Including validation on a form improves the user experience, by giving them immediate feedback on whether the information entered is valid. In this section, we are going to add validation rules to our generic components for ensuring a field has a value as well as ensuring a minimum number of characters have been entered. After we have enhanced our generic components, we'll implement validation in our question and answer forms.
Implementing validation
Adding validation rules to the Form component
We are going to add validation rules to the Form component so that they can be consumed like in the following example with a validationRules prop:
<Form
validationRules={{
title: [{ validator: required }, { validator: minLength...