-1

How to manage a large number of form field validations in React

I have 50 form fields in my application. How to manage validations for such a large number of fields. Is it better to use controlled components (using onChange) or Uncontrolled components?

I also need to show Customized error messages. For now, I am using constraint validation API.

Charan Teja
  • 959
  • 1
  • 7
  • 6
  • Maybe this could help [link](https://stackoverflow.com/questions/41296668/reactjs-form-input-validation/41297611#41297611) – Boky Jun 20 '18 at 09:19

1 Answers1

0

It depends on the validation type ... If you just need to check mandatory fields, just use the required attribute of input. If you want to validate a certain string pattern, use the HTML5 attibute pattern.

Here is a link to help you