Skip to content

Commit

Permalink
docs: adding example in readme
Browse files Browse the repository at this point in the history
  • Loading branch information
oieduardorabelo committed Jan 19, 2018
1 parent 179d8e8 commit e50e9c1
Showing 1 changed file with 22 additions and 5 deletions.
27 changes: 22 additions & 5 deletions packages/babel-preset-react-app/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,27 @@ npm install babel-preset-react-app --save-dev

Then create a file named `.babelrc` with following contents in the root folder of your project:

```js
{
"presets": ["react-app"]
}
```
```js
{
"presets": ["react-app"]
}
```

This preset uses the `useBuiltIns` option with [transform-object-rest-spread](http://babeljs.io/docs/plugins/transform-object-rest-spread/) and [transform-react-jsx](http://babeljs.io/docs/plugins/transform-react-jsx/), which assumes that `Object.assign` is available or polyfilled.

## Usage with TypeScript

To use this package with [`@babel/preset-typescript`](https://www.npmjs.com/package/@babel/preset-typescript), you need to disable `@babel/preset-flow` first.

You can achieve this by doing:

```
{
"presets": [
["react-app", {
"flow": false
}],
"@babel/typescript"
]
}
```

0 comments on commit e50e9c1

Please sign in to comment.