Registry / workflow / babel-preset-react-native-stage-0

babel-preset-react-native-stage-0

JSON →
library1.0.1jsnpmunverified

A Babel preset that enables stage-0 (latest experimental) JavaScript features in React Native projects. Version 1.0.1 is the latest stable release; the project is in maintenance mode. It wraps babel-preset-react-native with stage-0 transformations, including optional legacy decorator support via a sub-preset. Unlike combining babel-preset-react-native and babel-preset-stage-0 separately, this preset ensures compatibility and avoids common conflicts and errors in the RN bundler. No updates expected; users should consider newer alternatives like babel-preset-react-native with explicit plugin selection.

npm install babel-preset-react-native-stage-0
INSTALL
IMPORT
SIG · BABEL-PRESET-REACT
B
babel-preset-react-native-stage-0
workflowjavascriptv1.0.1
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default preset
"presets": ["react-native-stage-0"]
"presets": ["babel-preset-react-native-stage-0"]
Use the short name 'react-native-stage-0'; the full npm name will not be resolved.
decorator-support preset
"presets": ["react-native-stage-0/decorator-support"]
"presets": [["react-native-stage-0", { "decorators": true }]]
Use the sub-preset path; it is not an option.
require() usage
const presets = require('babel-preset-react-native-stage-0');
const presets = require('babel-preset-react-native-stage-0/decorator-support')
Sub-presets are not exported as separate modules; they are resolved via the 'react-native-stage-0/decorator-support' string in config.

Configures Babel to use the stage-0 preset for React Native, installation, cache clearing, and an example of the exponentiation operator.

// Create .babelrc in project root { "presets": ["react-native-stage-0"] } // Install npm install babel-preset-react-native-stage-0 --save // After adding preset, clear cache and restart packager watchman watch-del-all react-native start --reset-cache // Example usage in App.js using stage-0 features like exponentiation operator const square = (x) => x ** 2; console.log(square(5)); // 25
Debug
Known issues
deprecatedPackage has not been updated since 2018; consider migrating to modern alternatives.
fix
Use '@babel/preset-env' and '@babel/preset-react' with individual stage-0 plugins, or babel-preset-react-native with explicit plugin lists.
affects: *
breakingCombining this preset with the standalone 'babel-preset-stage-0' causes Babel errors and broken builds.
fix
Remove 'babel-preset-stage-0' from presets; this preset already includes stage-0 features.
affects: >=1.0.0
gotchaIncluding the full preset name 'babel-preset-react-native-stage-0' in the presets array will not be resolved; Babel requires the short name.
fix
Use 'react-native-stage-0' in the presets array.
affects: >=1.0.0
gotchaAfter adding this preset, you must clear the React Native packager cache to avoid strange Babel errors.
fix
Run 'watchman watch-del-all' and then start packager with '--reset-cache'.
affects: >=1.0.0
deprecatedLegacy decorator support (decorator-support sub-preset) may not work with newer Babel versions.
fix
Use '@babel/plugin-proposal-decorators' with the appropriate version.
affects: >=1.0.0
Errors
Common errors & fixes
Error: Cannot find module 'babel-preset-react-native-stage-0' from '/path/to/project'
Preset not installed or .babelrc uses the full npm name instead of the short name.
fix
Run 'npm install babel-preset-react-native-stage-0 --save' and use '"react-native-stage-0"' in presets.
ReferenceError: regeneratorRuntime is not defined
Stage-0 features like async/await require regenerator runtime, which may not be bundled.
fix
Add 'transform-regenerator' plugin or use babel-polyfill.
SyntaxError: Unexpected token (1:14) - ... while parsing file: /path/to/file.js
Incorrect usage of stage-0 syntax that is not transformed due to cache or missing plugin.
fix
Clear packager cache: 'watchman watch-del-all' then 'react-native start --reset-cache'.
error: bundling failed: Error: Couldn't find preset "react-native-stage-0/decorator-support" relative to directory
Using the decorator-support sub-preset path incorrectly in non-Babel config files.
fix
Ensure the preset is referenced only in .babelrc or babel config, not in other tools.
Upgrade
Version history
1.0.1latest on npm
Audit
Dependencies
babel-preset-react-nativerequiredBundles the core React Native Babel transforms
babel-preset-stage-0requiredProvides stage-0 Babel plugins (e.g., exponentiation, spread, etc.)
babel-plugin-transform-decorators-legacyoptionalOptional legacy decorator support; only needed when using decorator-support sub-preset
Agent activity
14 hits · last 30 days
node
12
OpenAI (training)
1
Resources
babel-preset-react-native-stage-0 — npm install babel-preset-react-native-stage-0 · libregistry