# babel-preset-react

> Babel preset for all React plugins.

Latest version **6.24.1** (published 2017-04-07) · MIT license · 0 weekly downloads

## Install

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

## Health

**Score 35/100 (D)** — status: abandoned.

Positive: no vulnerabilities; high maintenance score; popular repo.

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

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 6.24.1 |
| Published | 2017-04-07 |
| First published | 2015-10-29 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 6 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 44003 |
| Author | Sebastian McKenzie |
| Maintainers | amasad, hzoo, jmm, loganfsmyth, sebmck, thejameskyle |

## Links

- npm: https://www.npmjs.com/package/babel-preset-react
- Repository: https://github.com/babel/babel/tree/master/packages/babel-preset-react
- Homepage: https://babeljs.io/
- npm.io page: https://npm.io/package/babel-preset-react

## Dependencies (6)

- [babel-preset-flow](https://npm.io/package/babel-preset-flow.md) ^6.23.0
- [babel-plugin-syntax-jsx](https://npm.io/package/babel-plugin-syntax-jsx.md) ^6.3.13
- [babel-plugin-transform-react-jsx](https://npm.io/package/babel-plugin-transform-react-jsx.md) ^6.24.1
- [babel-plugin-transform-react-jsx-self](https://npm.io/package/babel-plugin-transform-react-jsx-self.md) ^6.22.0
- [babel-plugin-transform-react-jsx-source](https://npm.io/package/babel-plugin-transform-react-jsx-source.md) ^6.22.0
- [babel-plugin-transform-react-display-name](https://npm.io/package/babel-plugin-transform-react-display-name.md) ^6.23.0

## Recent versions

- 6.24.1 (latest) — 2017-04-07
- 7.0.0-beta.3 (next) — 2017-10-15
- 7.0.0-beta.2 — 2017-09-26
- 7.0.0-beta.1 — 2017-09-19
- 7.0.0-beta.0 — 2017-09-12
- 7.0.0-alpha.20 — 2017-08-30
- 7.0.0-alpha.19 — 2017-08-07
- 7.0.0-alpha.18 — 2017-08-03
- 7.0.0-alpha.17 — 2017-07-26
- 7.0.0-alpha.16 — 2017-07-25
- 7.0.0-alpha.15 — 2017-07-12
- 7.0.0-alpha.14 — 2017-07-12
- 7.0.0-alpha.12 — 2017-05-31
- 7.0.0-alpha.11 — 2017-05-31
- 7.0.0-alpha.10 — 2017-05-25
- … 22 more at https://npm.io/package/babel-preset-react/versions

## README

# babel-preset-react

> Babel preset for all React plugins.

This preset includes the following plugins/presets:

- [preset-flow](https://babeljs.io/docs/plugins/preset-flow/)
- [syntax-jsx](https://babeljs.io/docs/plugins/syntax-jsx/)
- [transform-react-jsx](https://babeljs.io/docs/plugins/transform-react-jsx/)
- [transform-react-display-name](https://babeljs.io/docs/plugins/transform-react-display-name/)

## Install

> You can also check out the React [Getting Started page](https://facebook.github.io/react/docs/hello-world.html)

> For more info, check out the setup page on the [cli](/docs/setup/) and the [usage](/docs/usage/cli/) docs.

Install the CLI and this preset

```sh
npm install --save-dev babel-cli babel-preset-react
```

Make a .babelrc config file with the preset

```sh
echo '{ "presets": ["react"] }' > .babelrc
```

Create a file to run on

```sh
echo '<h1>Hello, world!</h1>' > index.js
```

View the output

```sh
./node_modules/.bin/babel index.js
```

## Usage

### Via `.babelrc` (Recommended)

**.babelrc**

```json
{
  "presets": ["react"]
}
```

### Via CLI

```sh
babel script.js --presets react 
```

### Via Node API

```javascript
require("babel-core").transform("code", {
  presets: ["react"]
});
```

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