canirequire › Dual (CommonJS + ESM) › @fortawesome/react-fontawesome
Is @fortawesome/react-fontawesome ESM-only? Can you require() it?
Official React component for Font Awesome
Last verified Sep 9, 2026 against @fortawesome/react-fontawesome@3.5.0. JSON
Dual (CommonJS + ESM) Dual package — both require() and import work
@fortawesome/react-fontawesome publishes both a CommonJS entry and a native ESM entry (ESM added in 3.0.0). require("@fortawesome/react-fontawesome") and import "@fortawesome/react-fontawesome" both work on every supported Node.js version and in Bun.
Does @fortawesome/react-fontawesome@3.5.0 actually load? Runtime test results
Installed and executed on Sep 9, 2026 with require("@fortawesome/react-fontawesome") from a CommonJS file and import "@fortawesome/react-fontawesome" from an ES module.
| Runtime | require("@fortawesome/react-fontawesome") | import "@fortawesome/react-fontawesome" |
|---|---|---|
| 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 @fortawesome/react-fontawesome
ES modules (import)
import reactFontawesome from "@fortawesome/react-fontawesome";CommonJS (require)
const reactFontawesome = require("@fortawesome/react-fontawesome");Module format by version
Derived from the type, main and exports fields of every stable release on npm (52 versions; the newest 52 shown).
| Versions | Format | First published |
|---|---|---|
| 3.0.0 – 3.5.0 | Dual (CommonJS + ESM) | Aug 22, 2025 |
| 0.0.5 – 0.2.6 | CommonJS | Sep 6, 2017 |
Frequently asked
Is @fortawesome/react-fontawesome ESM-only?
@fortawesome/react-fontawesome@3.5.0 ships CommonJS and ESM builds. @fortawesome/react-fontawesome publishes both a CommonJS entry and a native ESM entry (ESM added in 3.0.0). require("@fortawesome/react-fontawesome") and import "@fortawesome/react-fontawesome" both work on every supported Node.js version and in Bun.
Can I require @fortawesome/react-fontawesome?
Yes. @fortawesome/react-fontawesome ships a CommonJS entry, so require("@fortawesome/react-fontawesome") works on every Node.js version, alongside the native ESM entry for import.
Does @fortawesome/react-fontawesome work in Bun?
Yes. import "@fortawesome/react-fontawesome" loaded successfully in Bun 1.4 on Sep 9, 2026.
Does @fortawesome/react-fontawesome ship TypeScript types?
Yes. @fortawesome/react-fontawesome bundles its own type declarations; no @types package is needed.
Links
Other dual (commonjs + esm) packages
- minimatch 10.2.6Dual
- brace-expansion 5.0.9Dual
- lru-cache 11.5.2Dual
- glob 13.0.6Dual
- eslint-visitor-keys 5.0.1Dual
- yallist 5.0.0Dual
- balanced-match 4.0.4Dual
- js-yaml 5.4.1Dual
Similar popularity
- @angular/material 22.1.6No entry
- @angular/cdk 22.1.6No entry
- @angular/animations 22.1.5ESM-only
- @ethersproject/networks 5.8.0CommonJS
- @vitejs/plugin-vue-jsx 5.1.6ESM-only
- @emotion/core 11.0.0CommonJS
- @babel/polyfill 7.12.1CommonJS
- @oclif/config 1.18.17CommonJS