1.0.2 • Published 4 years ago

react-hook-form-error v1.0.2

Weekly downloads
29
License
MIT
Repository
github
Last release
4 years ago

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

PropTypeRequiredDefaultDescription
namestringUnique name to register the custom input
errorsObject(optional when using errors) React Hook Form errors
asComponentComponent reference eg: <span />
messagesObjectkeys 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].

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago

0.0.1

4 years ago