# react-final-form-hooks **Repository Path**: mirrors_final-form/react-final-form-hooks ## Basic Information - **Project Name**: react-final-form-hooks - **Description**: React Hooks to bind to 🏁 Final Form's high performance subscription-based form state management engine - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2022-01-06 - **Last Updated**: 2026-04-05 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # 🏁 React Final Form Hooks  [](#backers) [](#sponsors) [](https://www.npmjs.com/package/react-final-form-hooks) [](https://www.npmjs.com/package/react-final-form-hooks) [](https://travis-ci.org/final-form/react-final-form-hooks) [](https://codecov.io/gh/final-form/react-final-form-hooks) [](https://github.com/prettier/prettier) ✅ Zero dependencies ✅ Only peer dependencies: React and [🏁 Final Form](https://github.com/final-form/final-form#-final-form) ✅ Opt-in subscriptions - only update on the state you need! ✅ 💥 [**1.2 kB gzipped**](https://bundlephobia.com/result?p=react-final-form-hooks) 💥 --- ## Installation ```bash npm install --save react-final-form-hooks final-form ``` or ```bash yarn add react-final-form-hooks final-form ``` ## Getting Started 🏁 React Final Form Hooks is the leanest possible way to connect 🏁 Final Form to React, to acheive subscriptions-based form state management using the [Observer pattern](https://en.wikipedia.org/wiki/Observer_pattern). #### ⚠️ This library will re-render your entire form on every state change, _as you type_. ⚠️ If performance is your goal, you are recommended to use [🏁 React Final Form](https://github.com/final-form/react-final-form). Also, that library does many other things for you, like managing checkbox and radio buttons properly. RFFHooks leaves all of that work to you. By default, 🏁 React Final Form Hooks subscribes to _all_ changes, but if you want to fine tune your form, you may specify only the form state that you care about for rendering your gorgeous UI. Here's what it looks like in your code: ```jsx import { useForm, useField } from 'react-final-form-hooks' const MyForm = () => { const { form, handleSubmit, values, pristine, submitting } = useForm({ onSubmit, // the function to call with your form values upon valid submit validate // a record-level validation function to check all form values }) const firstName = useField('firstName', form) const lastName = useField('lastName', form) return (
) } ``` ## Table of Contents - [What's the difference between `react-final-form-hooks` and the hooks introduced in `react-final-form v5`?](#whats-the-difference-between-react-final-form-hooks-and-the-hooks-introduced-in-react-final-form-v5) - [Examples](#examples) - [Simple Example](#simple-example) - [API](#api) - [`useField`](#usefield) - [`name : string`](#name--string) - [`form : Form`](#form--form) - [`validate? : (value:any) => any`](#validate--valueany--any) - [`subscription? : FieldSubscription`](#subscription--fieldsubscription) - [`useForm`](#useform) - [`onSubmit : (values:Object) => ?Object | Promise | void`](#onsubmit--valuesobject--object--promiseobject--void) - [`validate?: (values:Object) => Object | Promise