# Is react-hook-form ESM-only? Can you require() it?

> react-hook-form@7.87.0 ships CommonJS and ESM builds. Dual package — require() works on every Node.js version we test; import works too.

Performant, flexible and extensible forms library for React Hooks

Last verified Sep 9, 2026 against react-hook-form@7.87.0.

react-hook-form publishes both a CommonJS entry and a native ESM entry (ESM added in 6.9.6). require("react-hook-form") works on every Node.js version we test (18, 20, 22, 24 and 26) and in Bun. The package declares Node.js >=18.0.0. import "react-hook-form" works alongside it.

## What to do

1. Nothing to change. require("react-hook-form") works on every Node.js version we test (18, 20, 22, 24 and 26) and in Bun. The package declares Node.js >=18.0.0. import * as reactHookForm from "react-hook-form" works alongside it; use named imports for what the ESM entry exports.
2. TypeScript: types are bundled; install nothing extra.

## Facts

- Latest: 7.87.0 (Aug 30, 2026)
- Module format: Dual (CommonJS + ESM)
- Last CommonJS version: 7.87.0
- Native ESM since: 6.9.6
- TypeScript types: bundled
- Node engines: >=18.0.0
- Weekly downloads: 38.2M
- License: MIT

## Runtime test results for react-hook-form@7.87.0

Installed and executed on Sep 9, 2026 with require("react-hook-form") from a CommonJS file and import "react-hook-form" from an ES module.

| Runtime | require("react-hook-form") | import "react-hook-form" |
|---|---|---|
| Node.js 18 | works | works |
| Node.js 20 | works | works |
| Node.js 22 | works | works |
| Node.js 24 | works | works |
| Node.js 26 | works | works |
| Bun 1.4.0 | works | works |

## How to import react-hook-form

ES modules:

```js
import * as reactHookForm from "react-hook-form";
```

Namespace import shown because the ESM entry may have no default export; use named imports for what it exports.

CommonJS:

```js
const reactHookForm = require("react-hook-form");
```

## Module format by version

Derived from the type, main and exports fields of every stable release on npm (590 versions; the newest 60 shown).

| Versions | Format | First published |
|---|---|---|
| 7.50.1 – 7.87.0 | Dual (CommonJS + ESM) | Feb 6, 2024 |

## Frequently asked

**Is react-hook-form ESM-only?**

react-hook-form@7.87.0 ships CommonJS and ESM builds. react-hook-form publishes both a CommonJS entry and a native ESM entry (ESM added in 6.9.6). require("react-hook-form") works on every Node.js version we test (18, 20, 22, 24 and 26) and in Bun. The package declares Node.js >=18.0.0. import "react-hook-form" works alongside it.

**Can I require react-hook-form?**

Yes. react-hook-form ships a CommonJS entry alongside the native ESM entry. require("react-hook-form") works on every Node.js version we test (18, 20, 22, 24 and 26) and in Bun. The package declares Node.js >=18.0.0.

**Does react-hook-form work in Bun?**

Yes. import "react-hook-form" loaded successfully in Bun 1.4.0 on Sep 9, 2026.

**Does react-hook-form ship TypeScript types?**

Yes. react-hook-form bundles its own type declarations; no @types package is needed.

## Links

- [react-hook-form on npm](https://www.npmjs.com/package/react-hook-form)
- [Source repository](https://github.com/react-hook-form/react-hook-form)
- [HTML version](https://canirequire.com/package/react-hook-form/)
- [JSON version](https://canirequire.com/package/react-hook-form.json)

---

For scripts and AI agents: any package is at https://canirequire.com/package/<name>/index.md (Markdown) or https://canirequire.com/package/<name>.json (JSON); the site index is https://canirequire.com/llms.txt. Fetch the URL directly; no search needed.
