This library provides a High Component Order(HOC) for the real-time validation of React web form fields. The validation engine is using validatorjs package.
function MyComponent(props) {
return (
<div>
<input name="name" onChange={props.onFormChange}
value={props.formState.name.value}/>
<button disabled={props.formState.isPristine || !props.formState.isValid}>
Submit
</button>
</div>
)
}
const WithFormHandler = FormHandler({
name: "string|required"
})(MyComponent);
export default WithFormHandler
These libs and it's source code is distribute using MIT license. You can read the license here