{"id":19330,"library":"babel-preset-react-native-stage-0","title":"Babel Preset React Native Stage-0","description":"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.","status":"maintenance","version":"1.0.1","language":"javascript","source_language":"en","source_url":"https://github.com/skevy/babel-preset-react-native-stage-0","tags":["javascript","babel","babel-preset","react-native","babel-plugin"],"install":[{"cmd":"npm install babel-preset-react-native-stage-0","lang":"bash","label":"npm"},{"cmd":"yarn add babel-preset-react-native-stage-0","lang":"bash","label":"yarn"},{"cmd":"pnpm add babel-preset-react-native-stage-0","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Bundles the core React Native Babel transforms","package":"babel-preset-react-native","optional":false},{"reason":"Provides stage-0 Babel plugins (e.g., exponentiation, spread, etc.)","package":"babel-preset-stage-0","optional":false},{"reason":"Optional legacy decorator support; only needed when using decorator-support sub-preset","package":"babel-plugin-transform-decorators-legacy","optional":true}],"imports":[{"note":"Use the short name 'react-native-stage-0'; the full npm name will not be resolved.","wrong":"\"presets\": [\"babel-preset-react-native-stage-0\"]","symbol":"default preset","correct":"\"presets\": [\"react-native-stage-0\"]"},{"note":"Use the sub-preset path; it is not an option.","wrong":"\"presets\": [[\"react-native-stage-0\", { \"decorators\": true }]]","symbol":"decorator-support preset","correct":"\"presets\": [\"react-native-stage-0/decorator-support\"]"},{"note":"Sub-presets are not exported as separate modules; they are resolved via the 'react-native-stage-0/decorator-support' string in config.","wrong":"const presets = require('babel-preset-react-native-stage-0/decorator-support')","symbol":"require() usage","correct":"const presets = require('babel-preset-react-native-stage-0');"}],"quickstart":{"code":"// Create .babelrc in project root\n{\n  \"presets\": [\"react-native-stage-0\"]\n}\n\n// Install\nnpm install babel-preset-react-native-stage-0 --save\n\n// After adding preset, clear cache and restart packager\nwatchman watch-del-all\nreact-native start --reset-cache\n\n// Example usage in App.js using stage-0 features like exponentiation operator\nconst square = (x) => x ** 2;\nconsole.log(square(5)); // 25","lang":"javascript","description":"Configures Babel to use the stage-0 preset for React Native, installation, cache clearing, and an example of the exponentiation operator."},"warnings":[{"fix":"Use '@babel/preset-env' and '@babel/preset-react' with individual stage-0 plugins, or babel-preset-react-native with explicit plugin lists.","message":"Package has not been updated since 2018; consider migrating to modern alternatives.","severity":"deprecated","affected_versions":"*"},{"fix":"Remove 'babel-preset-stage-0' from presets; this preset already includes stage-0 features.","message":"Combining this preset with the standalone 'babel-preset-stage-0' causes Babel errors and broken builds.","severity":"breaking","affected_versions":">=1.0.0"},{"fix":"Use 'react-native-stage-0' in the presets array.","message":"Including the full preset name 'babel-preset-react-native-stage-0' in the presets array will not be resolved; Babel requires the short name.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Run 'watchman watch-del-all' and then start packager with '--reset-cache'.","message":"After adding this preset, you must clear the React Native packager cache to avoid strange Babel errors.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Use '@babel/plugin-proposal-decorators' with the appropriate version.","message":"Legacy decorator support (decorator-support sub-preset) may not work with newer Babel versions.","severity":"deprecated","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Run 'npm install babel-preset-react-native-stage-0 --save' and use '\"react-native-stage-0\"' in presets.","cause":"Preset not installed or .babelrc uses the full npm name instead of the short name.","error":"Error: Cannot find module 'babel-preset-react-native-stage-0' from '/path/to/project'"},{"fix":"Add 'transform-regenerator' plugin or use babel-polyfill.","cause":"Stage-0 features like async/await require regenerator runtime, which may not be bundled.","error":"ReferenceError: regeneratorRuntime is not defined"},{"fix":"Clear packager cache: 'watchman watch-del-all' then 'react-native start --reset-cache'.","cause":"Incorrect usage of stage-0 syntax that is not transformed due to cache or missing plugin.","error":"SyntaxError: Unexpected token (1:14) - ... while parsing file: /path/to/file.js"},{"fix":"Ensure the preset is referenced only in .babelrc or babel config, not in other tools.","cause":"Using the decorator-support sub-preset path incorrectly in non-Babel config files.","error":"error: bundling failed: Error: Couldn't find preset \"react-native-stage-0/decorator-support\" relative to directory"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}