Performant, flexible and extensible forms with easy to use validation.
Install
$ npm install react-hook-form-error
Quickstart
import React from 'react';import useForm from 'react-hook-form';import RHFError from 'react-hook-form-error'; { const handleSubmit register errors = ; return <form => <input ="test" = /> <RHFError ="test" = /> <button>submit</button> </form> ;}
API
Prop | Type | Required | Default | Description |
---|---|---|---|---|
name |
string | ✓ | Unique name to register the custom input | |
errors |
Object | ✓ | (optional when using errors) React Hook Form errors | |
as |
Component | Component reference eg: <span /> |
||
messages |
Object | keys of error type's message |
Backers
Thank goes to all our backers! [Become a backer].
Contributors
Thanks goes to these wonderful people. [Become a contributor].