Sign in
Log inSign up
What is the best way to validate forms in React?

What is the best way to validate forms in React?

Arvind Bhardwaj's photo
Arvind Bhardwaj
·Jan 4, 2016

Recently I started exploring React. Soon I reached to create and validate forms. It was OK till I created form components. But when it came to form validation, I started scratching my head. I searched on the web endlessly. What I found was third party React components like formsy-react and others.

My question is: 1. Do we have a default way of applying all types of form validations in React? 2. Or we have to depend on third party components? 3. Or write our own logic around validation (I have always hated form validations, at least in 2016 I dont want to do validations on my own for God's sake!).

Then I took a look at Angular 2 form validation! It was surprisingly well supported and easy. It is also supported in Angular 1. From all opinionated debates on the web I was under impression that React is superior to Angular. But in this scenario, it seems Angular has a great lead.

Am I missing anything?

Hassle-free blogging platform that developers and teams love.
  • Docs by Hashnode
    New
  • Blogs
  • AI Markdown Editor
  • GraphQL APIs
  • Open source Starter-kit

© Hashnode 2024 — LinearBytes Inc.

Privacy PolicyTermsCode of Conduct