README.md

React Validify

Why

Validating form inputs in React is one of two things. A manual process that you build into every app, or something you get from pulling in a huge library. This package aims to provide form validation with the smallest amount of code change to your apps! Make a small field wrapper that receives input props and handles error messages, set some rules, and that's it!

Usage

This component is the simplest way to validate form inputs in React. There's two things to learn. The Form accepts a prop called rules. This is an object with the names of all yours inputs and the rules for them. Rules can be found here. Place the submit prop on any element that you want to trigger the validation. The onClick will not be triggered until the rules pass. If validation fails, error messages will be passed to the inputs as an error prop.

Workflow:

Import Form

Build a wrapper around inputs. It needs to handle when there's an error passed in: