canirequire › CommonJS › react-native
Is react-native ESM-only? Can you require() it?
A framework for building native apps using React
Latest version 0.87.1, published Aug 26, 2026. JSON
CommonJS CommonJS — require() works on every Node.js version
react-native ships CommonJS only. require("react-native") works everywhere. import "react-native" also works because Node.js and Bun can import CommonJS from ES modules, but only the default export is guaranteed; named imports depend on Node's static analysis of the module.
Does react-native@0.87.1 actually load? Runtime test results
Runtime probe pending for this version. The values below are what package.json declares; they are refreshed once the probe runs.
| Runtime | require("react-native") | import "react-native" |
|---|---|---|
| Node.js 18 | ✓ expected | ✓ expected |
| Node.js 20 | ✓ expected | ✓ expected |
| Node.js 22 | ✓ expected | ✓ expected |
| Node.js 24 | ✓ expected | ✓ expected |
| Node.js 26 | ✓ expected | ✓ expected |
| Bun 1.4 | pending | pending |
Install failed in our sandbox: PROBE_TIMEOUT The rows above show what package.json declares.
How to import react-native
ES modules (import)
import reactNative from "react-native";Named imports from a CommonJS package only work when Node.js can statically detect them. If a named import fails, use the default import and destructure.
CommonJS (require)
const reactNative = require("react-native");Module format by version
Derived from the type, main and exports fields of every stable release on npm (381 versions; the newest 60 shown).
| Versions | Format | First published |
|---|---|---|
| 0.76.2 – 1000.0.0 | CommonJS | Nov 14, 2024 |
Frequently asked
Is react-native ESM-only?
react-native@0.87.1 is a CommonJS package. react-native ships CommonJS only. require("react-native") works everywhere. import "react-native" also works because Node.js and Bun can import CommonJS from ES modules, but only the default export is guaranteed; named imports depend on Node's static analysis of the module.
Can I import react-native with ES module syntax?
Yes. import reactNative from "react-native" works in Node.js and Bun because they support importing CommonJS modules. Named imports work only when Node.js can statically detect the exports.
Does react-native ship TypeScript types?
Yes. react-native bundles its own type declarations; no @types package is needed.
Links
Other commonjs packages
- debug 4.4.3CommonJS
- semver 7.8.5CommonJS
- ms 2.1.3CommonJS
- picomatch 4.0.7CommonJS
- ajv 8.20.0CommonJS
- source-map 0.8.0CommonJS
- react-is 19.2.8CommonJS
- readable-stream 4.7.0CommonJS