In Laravel 5.7 React app, getting the error: 'classProperties' isn't currently enabled
Cretae .babelrc file in root folder.
Write in .babelrc:
{ "plugins": ["@babel/plugin-proposal-class-properties"] }
Run npm install --save-dev @babel/plugin-proposal-class-properties
Run npm run dev
Hope it will help you.
I just tested on Laravel Framework 5.7.19 and the following steps work:
- Make sure your
.babelrc
file is in the root folder of your application, and add the following code:
{
"plugins": ["@babel/plugin-proposal-class-properties"]
}
Run
npm install --save-dev @babel/plugin-proposal-class-properties
.Run
npm run watch
.
Simple Add this to your
package.json
"babel": {
"presets": [
"@babel/preset-env",
"@babel/preset-react"
],
"plugins": [
"@babel/plugin-proposal-class-properties"
]
}