Skip to content

Commit e73f3f0

Browse files
Enable useBuiltIns with transform-react-jsx
1 parent ab5d90b commit e73f3f0

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,4 @@ Then create a file named `.babelrc` with following contents in the root folder o
2424
}
2525
```
2626

27-
This preset uses the `useBuiltIns` option with [transform-object-rest-spread](http://babeljs.io/docs/plugins/transform-object-rest-spread/), which assumes `Object.assign` is available or polyfilled.
27+
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.

packages/babel-preset-react-app/index.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,14 @@ var path = require('path');
1313
const plugins = [
1414
// class { handleClick = () => { } }
1515
require.resolve('babel-plugin-transform-class-properties'),
16+
// The following two plugins use Object.assign directly, instead of Babel's
17+
// extends helper. Note that this assumes `Object.assign` is available.
1618
// { ...todo, completed: true }
1719
[require.resolve('babel-plugin-transform-object-rest-spread'), {
18-
// Use Object.assign directly, instead of extends helper. Note that this
19-
// assumes Object.assign is available/polyfilled.
20+
useBuiltIns: true
21+
}],
22+
// Transforms JSX
23+
[require.resolve('babel-plugin-transform-react-jsx'), {
2024
useBuiltIns: true
2125
}],
2226
// function* () { yield 42; yield 43; }

0 commit comments

Comments
 (0)