React Hooks Form
React Hooks Form offers an easy way to manage your forms in React. It's built using the famous React Hooks!
Documentation
You can find the complete documentation here.
Usage
Install via NPM or Yarn:
npm install react-hooks-form --save
yarn add react-hooks-form
The following code snippet is a basic example of using React Hooks Form.
import React from 'react'import Form FormField from 'react-hooks-form' { try await catch error } { return <Form => <FormField ="input" ="fullName" ="text" /> <FormField ="input" ="email" ="text" /> <FormField ="input" ="password" ="password" /> <button ="submit">Sign Up</button> </Form> }
Hooks
// Hook to field valueconst amount = // Hook to field error, focus status and ...const active error invalid visited } = // Hook to get form all valuesconst values = // Hook to form submission status, errors and ...const submitting submitFailed submitSucceeded error } = // Hook to access form APIconst formApi = // There are plenty of methods