Skip to content

Commit e50e9c1

Browse files
docs: adding example in readme
1 parent 179d8e8 commit e50e9c1

File tree

1 file changed

+22
-5
lines changed

1 file changed

+22
-5
lines changed

packages/babel-preset-react-app/README.md

+22-5
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,27 @@ npm install babel-preset-react-app --save-dev
2424

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

27-
```js
28-
{
29-
"presets": ["react-app"]
30-
}
31-
```
27+
```js
28+
{
29+
"presets": ["react-app"]
30+
}
31+
```
3232

3333
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.
34+
35+
## Usage with TypeScript
36+
37+
To use this package with [`@babel/preset-typescript`](https://www.npmjs.com/package/@babel/preset-typescript), you need to disable `@babel/preset-flow` first.
38+
39+
You can achieve this by doing:
40+
41+
```
42+
{
43+
"presets": [
44+
["react-app", {
45+
"flow": false
46+
}],
47+
"@babel/typescript"
48+
]
49+
}
50+
```

0 commit comments

Comments
 (0)