Skip to content

Commit d12b4b6

Browse files
renatoagdsianschmitz
authored andcommitted
Add optional chaining and nullish coalescing operators support (#7438)
1 parent 211694a commit d12b4b6

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

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

+4
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,10 @@ module.exports = function(api, opts, env) {
196196
],
197197
// Adds syntax support for import()
198198
require('@babel/plugin-syntax-dynamic-import').default,
199+
// Adds syntax support for optional chaining (.?)
200+
require('@babel/plugin-proposal-optional-chaining').default,
201+
// Adds syntax support for default value using ?? operator
202+
require('@babel/plugin-proposal-nullish-coalescing-operator').default,
199203
isEnvTest &&
200204
// Transform dynamic import to require
201205
require('babel-plugin-dynamic-import-node'),

packages/babel-preset-react-app/package.json

+2
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,10 @@
2424
"@babel/core": "7.7.2",
2525
"@babel/plugin-proposal-class-properties": "7.7.0",
2626
"@babel/plugin-proposal-decorators": "7.7.0",
27+
"@babel/plugin-proposal-nullish-coalescing-operator": "7.4.4",
2728
"@babel/plugin-proposal-numeric-separator": "7.2.0",
2829
"@babel/plugin-proposal-object-rest-spread": "7.6.2",
30+
"@babel/plugin-proposal-optional-chaining": "7.6.0",
2931
"@babel/plugin-syntax-dynamic-import": "7.2.0",
3032
"@babel/plugin-transform-destructuring": "7.6.0",
3133
"@babel/plugin-transform-flow-strip-types": "7.6.3",

0 commit comments

Comments
 (0)