react-hook-form-error
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

Performant, flexible and extensible forms with easy to use validation.

npm downloads npm npm Tweet Join the community on Spectrum

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';
 
function App() {
  const { handleSubmit, register, errors } = useForm();
 
  return (
    <form onSubmit={handleSubmit(data => console.log(data))}>
      <input name="test" ref={register} />
      <RHFError name="test" errors={errors} />
      <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].

Readme

Keywords

none

Package Sidebar

Install

npm i react-hook-form-error

Weekly Downloads

163

Version

1.0.2

License

MIT

Unpacked Size

7.34 kB

Total Files

6

Last publish

Collaborators

  • bluebill1049