@kettanaito
Full-stack JavaScript developer
Nothing here yet.
Nothing here yet.
No blogs yet.
Hi! I encourage you to try React Advanced Form . This is a new form library which solves a lot of issues with the modern form solutions. It proves than you can create advanced forms without obscure HoC configurations, tons of boilerplate, and even keeping your form component stateless. There are lot of other features shipped out of the box as well. For your validation case it would offer you to declare a simple validation schema: import isEmail from 'validator/lib/isEmail' ; export default { type: { /* Use anything as a resolver function */ email: ({ value }) => isEmail( value ), password: { /* Have multiple validation rules on the same selector with ease */ capitalLetter: ({ value }) => /[A-Z]/.test( value ) oneNumber: ({ value }) => /[ 0 -9 ]/.test( value ) } }, name: { confirmPassword: ({ value , fields }) => { /* Declare validation logic based on the state of other fields */ return ( value === fields.userPassword.password); } } }; It focuses on the validation as an independent pure schema which is handled by the form automatically. Stop mixing view with validation and start expecting the form to do more than just fields rendering. See some guidelines on the validation .