We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
class-properties
1 parent 06176e1 commit 1d4fdc2Copy full SHA for 1d4fdc2
packages/babel-preset-react-app/index.js
@@ -92,7 +92,14 @@ module.exports = function(api, opts) {
92
// don't work without it: https://github.com/babel/babel/issues/7215
93
require('@babel/plugin-transform-destructuring').default,
94
// class { handleClick = () => { } }
95
- require('@babel/plugin-proposal-class-properties').default,
+ // Enable loose mode to use assignment instead of defineProperty
96
+ // See discussion in https://github.com/facebook/create-react-app/issues/4263
97
+ [
98
+ require('@babel/plugin-proposal-class-properties').default,
99
+ {
100
+ loose: true,
101
+ },
102
+ ],
103
// The following two plugins use Object.assign directly, instead of Babel's
104
// extends helper. Note that this assumes `Object.assign` is available.
105
// { ...todo, completed: true }
0 commit comments