canirequire

canirequireDual (CommonJS + ESM) › react-hook-form

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

Performant, flexible and extensible forms library for React Hooks

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

Dual (CommonJS + ESM) Dual package — both require() and import work

react-hook-form publishes both a CommonJS entry and a native ESM entry (ESM added in 6.9.6). require("react-hook-form") and import "react-hook-form" both work on every supported Node.js version and in Bun.

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

Does react-hook-form@7.87.0 actually load? Runtime test results

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.

Runtimerequire("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✓ works✓ works

How to import react-hook-form

ES modules (import)

import reactHookForm from "react-hook-form";

CommonJS (require)

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).

VersionsFormatFirst published
7.50.1 – 7.87.0Dual (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") and import "react-hook-form" both work on every supported Node.js version and in Bun.

Can I require react-hook-form?

Yes. react-hook-form ships a CommonJS entry, so require("react-hook-form") works on every Node.js version, alongside the native ESM entry for import.

Does react-hook-form work in Bun?

Yes. import "react-hook-form" loaded successfully in Bun 1.4 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

Other dual (commonjs + esm) packages

Similar popularity