In Laravel 5.7 React app, getting the error: 'classProperties' isn't currently enabled

  1. Cretae .babelrc file in root folder.

  2. Write in .babelrc:

{ "plugins": ["@babel/plugin-proposal-class-properties"] }

  1. Run npm install --save-dev @babel/plugin-proposal-class-properties

  2. Run npm run dev

enter image description here

Hope it will help you.


I just tested on Laravel Framework 5.7.19 and the following steps work:

  1. Make sure your .babelrc file is in the root folder of your application, and add the following code:
{
  "plugins": ["@babel/plugin-proposal-class-properties"]
}
  1. Run npm install --save-dev @babel/plugin-proposal-class-properties.

  2. 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"
        ]
    }