Skip to content

Commit

Permalink
Fix optional chaining and nullish coalescing support (#8526)
Browse files Browse the repository at this point in the history
  • Loading branch information
ianschmitz committed Feb 20, 2020
1 parent 038e6fa commit 2030ee1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
6 changes: 6 additions & 0 deletions packages/babel-preset-react-app/create.js
Expand Up @@ -185,6 +185,12 @@ module.exports = function(api, opts, env) {
removeImport: true,
},
],
// Optional chaining and nullish coalescing are supported in @babel/preset-env,
// but not yet supported in webpack due to support missing from acorn.
// These can be removed once webpack has support.
// See https://github.com/facebook/create-react-app/issues/8445#issuecomment-588512250
require('@babel/plugin-proposal-optional-chaining').default,
require('@babel/plugin-proposal-nullish-coalescing-operator').default,
].filter(Boolean),
overrides: [
isFlowEnabled && {
Expand Down
2 changes: 2 additions & 0 deletions packages/babel-preset-react-app/package.json
Expand Up @@ -24,7 +24,9 @@
"@babel/core": "7.8.4",
"@babel/plugin-proposal-class-properties": "7.8.3",
"@babel/plugin-proposal-decorators": "7.8.3",
"@babel/plugin-proposal-nullish-coalescing-operator": "7.8.3",
"@babel/plugin-proposal-numeric-separator": "7.8.3",
"@babel/plugin-proposal-optional-chaining": "7.8.3",
"@babel/plugin-transform-flow-strip-types": "7.8.3",
"@babel/plugin-transform-react-display-name": "7.8.3",
"@babel/plugin-transform-runtime": "7.8.3",
Expand Down

0 comments on commit 2030ee1

Please sign in to comment.