How to configure ES6 with Laravel 7 React

  • Create .babelrc file in the root of your project folder, and paste the following config:
{ 
    “plugins”: [ 
        “@babel/plugin-proposal-class-properties” 
    ] 
}
  • Install required dependency
npm install --save-dev @babel/plugin-proposal-class-properties
  • Compile react
npm run dev