React Hook Form vs Formik is a question of architecture. React Hook Form keeps fields uncontrolled and reads values from the DOM, so only the changed field re-renders. Formik keeps every value in React state, which re-renders the whole form on each keystroke.
Both validate and both handle submission, but they trade re-renders for a different mental model. The examples below build the same login form in each library so the difference is concrete.
The core difference at a glance
| Aspect | React Hook Form | Formik |
|---|---|---|
| Model | Uncontrolled | Controlled |
| Re-renders | Field-level and minimal | Whole form on each keystroke |
| API style | Hook with register | Hook or components |
| Validation | Built-in rules or resolver | validate or validationSchema |
| Dependencies | None | lodash, deepmerge, and more |
The table is the decision. If you want the fewest re-renders, React Hook Form wins by design. If you want every value mirrored in state where other code can read it live, Formik's model is closer to plain React.
React Hook Form in a few lines
React Hook Form registers each field by name and collects the values on submit. The input stays uncontrolled, so typing does not trigger a render.
import { useForm } from "react-hook-form";
export default function RHFLogin() {
const { register, handleSubmit, formState: { errors } } = useForm();
function onSubmit(data) {
alert(JSON.stringify(data));
}
// the return below continues this same componentThe register call attaches the email field and the required rule, then the return block renders the form and its error message.
return (
<form onSubmit={handleSubmit(onSubmit)}>
<label htmlFor="email">Email</label>
<input id="email" type="email" {...register("email", { required: true })} />
{errors.email && <p role="alert">Email is required.</p>}
<button type="submit">Log in</button>
</form>
);
}The register call returns the ref and change handlers for the input. Validation runs on submit, and the errors object updates without re-rendering unrelated fields. For the full setup and schema integration, see the React Hook Form tutorial.
Formik in a few lines
Formik tracks values in state and exposes them through a formik object. Every keystroke calls its handleChange handler and re-renders the form.
import { useFormik } from "formik";
export default function FormikLogin() {
const formik = useFormik({
initialValues: { email: "" },
onSubmit: (values) => alert(JSON.stringify(values)),
});
return (
<form onSubmit={formik.handleSubmit}>
<label htmlFor="email">Email</label>
<input id="email" type="email" name="email" value={formik.values.email} onChange={formik.handleChange} />
<button type="submit">Log in</button>
</form>
);
}The value prop comes from formik.values.email, so the field is controlled and any part of the component can read the latest email at any time. Formik also ships components such as Field and ErrorMessage, but the underlying model stays controlled.
Validation and dependencies
Both libraries validate, but they wire it differently. React Hook Form prefers built-in rules or a resolver, while Formik prefers a validate function or a Yup validationSchema.
- React Hook Form has zero runtime dependencies and ships frequent 7.x releases.
- Formik depends on lodash and deepmerge, and its 2.4.x releases come slowly.
- Both accept schema libraries, so validation power is a tie.
The dependency difference matters for bundle size and supply chain surface, while the release cadence matters for how fast a library adopts new React behavior. Both also hand you the same final result: a data object on submit and per-field error messages, so the learning curve is similar even though the internals differ.
Which should you use?
Start with React Hook Form for most new projects. Its uncontrolled model means faster forms with less code, and it is the more actively maintained choice.
- Choose React Hook Form for new forms, large forms, and performance-sensitive lists.
- Choose Formik when you want values in state for live side effects, or when a codebase already uses it.
- Choose plain state when the form is small and a library adds nothing.
A common false equivalence is treating both as interchangeable wrappers around the same thing. They are not. The uncontrolled versus controlled split changes when re-renders happen and where values live, so the choice shapes every field you write.
For the plain React version of either model, see how to build forms in React, and for hand-written checks see React form validation without a library.
Rune AI
Key Insights
- React Hook Form is uncontrolled, Formik is controlled.
- React Hook Form re-renders field-level, Formik re-renders the whole form.
- React Hook Form has no dependencies, Formik pulls in lodash and friends.
- Both support schema validation through a resolver or validationSchema.
- Start with React Hook Form unless you specifically need a controlled model.
Frequently Asked Questions
Which is more popular, React Hook Form or Formik?
Does Formik work with React 19?
Can React Hook Form do schema validation?
Conclusion
React Hook Form is uncontrolled and re-renders minimally, while Formik is controlled and keeps every value in state. Choose React Hook Form for most new forms, and Formik when you want a controlled model.
More in this topic
How to Build a Dropdown Menu in React
Build a React dropdown menu with the ARIA menu button pattern. Handle open and close, keyboard arrows, and clicks outside the menu.
How to Animate React Components with Motion
Animate React components with the Motion library. Set up motion, add enter, hover, and exit animations, and respect reduced motion.
Headless UI Components Explained: Logic Without Locked Styling
Understand headless UI components and how libraries like Radix give you unstyled, accessible behavior that you style yourself.