# babel-preset-react-native

> Babel preset for React Native applications

Latest version **4.0.1** (published 2018-09-10) · MIT license · 0 weekly downloads

## Install

```sh
npm install babel-preset-react-native
pnpm add babel-preset-react-native
yarn add babel-preset-react-native
bun add babel-preset-react-native
```

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: no vulnerabilities; high maintenance score.

Warnings: low downloads; no types; no esm support.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 4.0.1 |
| Published | 2018-09-10 |
| First published | 2015-10-30 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 32 |
| Unpacked size | 14.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 5628 |
| Maintainers | abi, anp, bestander, brentvatne, ccheever, davidaurelio, dikaiosune, dsokal, esamelson, evanbacon, expoadmin, fb, fson, grabbou, ide, jakubste, janicduplessis, jeanlauliac, jesseruder, kuvos, mjesun, nikki93, peterpme, rafeca, skevy, terribleben |
| Keywords | babel, preset, react-native |

## Links

- npm: https://www.npmjs.com/package/babel-preset-react-native
- Repository: https://github.com/facebook/metro/tree/master/packages/metro-react-native-babel-preset
- Homepage: https://github.com/facebook/metro/tree/master/packages/metro-react-native-babel-preset/README.md
- Issues: https://github.com/facebook/react-native/issues
- npm.io page: https://npm.io/package/babel-preset-react-native

## Dependencies (32)

- [babel-template](https://npm.io/package/babel-template.md) ^6.24.1
- [react-transform-hmr](https://npm.io/package/react-transform-hmr.md) ^1.0.4
- [babel-plugin-syntax-jsx](https://npm.io/package/babel-plugin-syntax-jsx.md) ^6.5.0
- [babel-plugin-syntax-flow](https://npm.io/package/babel-plugin-syntax-flow.md) ^6.5.0
- [babel-plugin-react-transform](https://npm.io/package/babel-plugin-react-transform.md) ^3.0.0
- [babel-plugin-transform-react-jsx](https://npm.io/package/babel-plugin-transform-react-jsx.md) ^6.5.0
- [babel-plugin-syntax-dynamic-import](https://npm.io/package/babel-plugin-syntax-dynamic-import.md) ^6.18.0
- [babel-plugin-transform-regenerator](https://npm.io/package/babel-plugin-transform-regenerator.md) ^6.5.0
- [babel-plugin-check-es2015-constants](https://npm.io/package/babel-plugin-check-es2015-constants.md) ^6.5.0
- [babel-plugin-syntax-async-functions](https://npm.io/package/babel-plugin-syntax-async-functions.md) ^6.5.0
- [babel-plugin-syntax-class-properties](https://npm.io/package/babel-plugin-syntax-class-properties.md) ^6.5.0
- [babel-plugin-transform-es2015-for-of](https://npm.io/package/babel-plugin-transform-es2015-for-of.md) ^6.5.0
- [babel-plugin-transform-es2015-spread](https://npm.io/package/babel-plugin-transform-es2015-spread.md) ^6.5.0
- [babel-plugin-transform-object-assign](https://npm.io/package/babel-plugin-transform-object-assign.md) ^6.5.0
- [babel-plugin-transform-es2015-classes](https://npm.io/package/babel-plugin-transform-es2015-classes.md) ^6.5.0
- [babel-plugin-transform-es2015-literals](https://npm.io/package/babel-plugin-transform-es2015-literals.md) ^6.5.0
- [babel-plugin-transform-class-properties](https://npm.io/package/babel-plugin-transform-class-properties.md) ^6.5.0
- [babel-plugin-transform-flow-strip-types](https://npm.io/package/babel-plugin-transform-flow-strip-types.md) ^6.5.0
- [babel-plugin-transform-react-jsx-source](https://npm.io/package/babel-plugin-transform-react-jsx-source.md) ^6.5.0
- [babel-plugin-transform-es2015-parameters](https://npm.io/package/babel-plugin-transform-es2015-parameters.md) ^6.5.0
- [babel-plugin-transform-object-rest-spread](https://npm.io/package/babel-plugin-transform-object-rest-spread.md) ^6.5.0
- [babel-plugin-transform-react-display-name](https://npm.io/package/babel-plugin-transform-react-display-name.md) ^6.5.0
- [babel-plugin-transform-es2015-block-scoping](https://npm.io/package/babel-plugin-transform-es2015-block-scoping.md) ^6.5.0
- [babel-plugin-transform-es2015-destructuring](https://npm.io/package/babel-plugin-transform-es2015-destructuring.md) ^6.5.0
- [babel-plugin-transform-es2015-function-name](https://npm.io/package/babel-plugin-transform-es2015-function-name.md) ^6.5.0
- [babel-plugin-syntax-trailing-function-commas](https://npm.io/package/babel-plugin-syntax-trailing-function-commas.md) ^6.5.0
- [babel-plugin-transform-es2015-arrow-functions](https://npm.io/package/babel-plugin-transform-es2015-arrow-functions.md) ^6.5.0
- [babel-plugin-transform-es2015-modules-commonjs](https://npm.io/package/babel-plugin-transform-es2015-modules-commonjs.md) ^6.5.0
- [babel-plugin-transform-exponentiation-operator](https://npm.io/package/babel-plugin-transform-exponentiation-operator.md) ^6.5.0
- [babel-plugin-transform-es2015-template-literals](https://npm.io/package/babel-plugin-transform-es2015-template-literals.md) ^6.5.0
- [babel-plugin-transform-es2015-computed-properties](https://npm.io/package/babel-plugin-transform-es2015-computed-properties.md) ^6.5.0
- [babel-plugin-transform-es2015-shorthand-properties](https://npm.io/package/babel-plugin-transform-es2015-shorthand-properties.md) ^6.5.0

## Alternatives

- [@openai/codex-sdk](https://npm.io/package/@openai/codex-sdk.md) — 731.4K weekly downloads
- [babel-plugin-transform-react-jsx](https://npm.io/package/babel-plugin-transform-react-jsx.md) — 565.0K weekly downloads
- [babel-helper-remove-or-void](https://npm.io/package/babel-helper-remove-or-void.md) — 508.5K weekly downloads
- [@pnpm/store-controller-types](https://npm.io/package/@pnpm/store-controller-types.md) — 186.9K weekly downloads
- [react-native-signature-canvas](https://npm.io/package/react-native-signature-canvas.md) — 155.6K weekly downloads

## Recent versions

- 4.0.1 (latest) — 2018-09-10
- 5.0.2 (next) — 2018-06-15
- 5.0.1 — 2018-05-19
- 5.0.0 — 2018-04-20
- 4.0.0 — 2017-09-14
- 3.0.2 — 2017-08-30
- 2.0.1 — 2017-08-25
- 3.0.2-rc.0 — 2017-08-23
- 3.0.1 — 2017-08-22
- 3.0.0 — 2017-08-16
- 2.1.0 — 2017-07-05
- 2.0.0 — 2017-06-14
- 1.9.2 — 2017-05-12
- 1.9.1 — 2016-12-15
- 1.9.0 — 2016-05-26
- … 23 more at https://npm.io/package/babel-preset-react-native/versions

## README

> ## This Project Is Deprecated

> `babel-preset-react-native` has been replaced by [`metro-react-native-babel-preset`](https://github.com/facebook/metro/tree/master/packages/metro-react-native-babel-preset), which now uses Babel 7.0.0. If you're using React Native v0.57 or later you should update your babel config to point to the `metro-react-native-babel-preset` preset.

# babel-preset-react-native

Babel presets for React Native applications. React Native itself uses this Babel preset by default when transforming your app's source code.

If you wish to use a custom Babel configuration by writing a `.babelrc` file in your project's root directory, you must specify all the plugins necessary to transform your code. React Native does not apply its default Babel configuration in this case. So, to make your life easier, you can use this preset to get the default configuration and then specify more plugins that run before it.

## Usage

As mentioned above, you only need to use this preset if you are writing a custom `.babelrc` file.

### Installation

Install `babel-preset-react-native` in your app:
```sh
npm i babel-preset-react-native --save-dev
```

### Configuring Babel

Then, create a file called `.babelrc` in your project's root directory. The existence of this `.babelrc` file will tell React Native to use your custom Babel configuration instead of its own. Then load this preset:
```
{
  "presets": ["react-native"]
}
```

You can further customize your Babel configuration by specifying plugins and other options. See [Babel's `.babelrc` documentation](https://babeljs.io/docs/usage/babelrc/) to learn more.

## Help and Support

If you get stuck configuring Babel, please ask a question on Stack Overflow or find a consultant for help. If you discover a bug, please open up an issue.

---
_Source: https://npm.io/package/babel-preset-react-native · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
