How to fix Support for the experimental syntax ‘classProperties’ isn’t enabled

Error:

esources/reactSkilledMigrantPoint/containers/TaskAddContainer.js
failed (from ./node_modules/babel-loader/lib/index.js):
F:\document_root_002\xinxilan.org\laravel\resources\reactSkilledMigrantPoint\containers\TaskAddContainer.js: Support for the experimental syntax ‘classProperties’ isn’t enabled (20:18):

andleChange = event => {
^
this.setState({
[event.currentTarget.name]: event.currentTarget.value
});

lugin-proposal-class-properties (https://git.io/vb4SL) to the ‘plugins’ section of your Babel config to enable transformation.
t.raise (F:\document_root_002\xinxilan.org\laravel\node_modules\@babel\parser\lib\index.js:3851:17)

 

How to fix:

add .babelrc to the root path:

{
“presets”: [
“@babel/preset-env”,
“@babel/preset-react”
],
“plugins”: [
[
“@babel/plugin-proposal-class-properties”,
{
“loose”: true
}
]
]
}

 

install 3rd libraries.

Leave a Reply

Your email address will not be published. Required fields are marked *