Skip to content

Commit

Permalink
Merge pull request #24 from facebook/next
Browse files Browse the repository at this point in the history
Enable loose mode for `class-properties` (facebook#4248)
  • Loading branch information
tvalentius authored Apr 8, 2018
2 parents f3b3360 + 1d4fdc2 commit aebb0e3
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion packages/babel-preset-react-app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,14 @@ module.exports = function(api, opts) {
// don't work without it: https://github.com/babel/babel/issues/7215
require('@babel/plugin-transform-destructuring').default,
// class { handleClick = () => { } }
require('@babel/plugin-proposal-class-properties').default,
// Enable loose mode to use assignment instead of defineProperty
// See discussion in https://github.com/facebook/create-react-app/issues/4263
[
require('@babel/plugin-proposal-class-properties').default,
{
loose: true,
},
],
// The following two plugins use Object.assign directly, instead of Babel's
// extends helper. Note that this assumes `Object.assign` is available.
// { ...todo, completed: true }
Expand Down

0 comments on commit aebb0e3

Please sign in to comment.