1

In my reactjs component I have this code:

increment = () => {
     store.dispatch({type: 'INC'});
}

When I run npm start in the console I get:

Module build failed: SyntaxError: Missing class properties transform.

I installed :

npm install --save-dev babel-plugin-transform-class-properties

And also added this to my .babelrc :

  "plugins": [
    "transform-class-properties"
  ],

  "presets": [
    "es2015",
    "react",
    "stage-0"
  ],

How can I resolve this?

bier hier
  • 20,970
  • 42
  • 97
  • 166

1 Answers1

0

Have you seen this other post: Error: Missing class properties transform ?

I had a similar problem, and, as one of the comments on the accepted answer above suggests, I had the presets listed in both my .babelrc file and my webpack.config. I removed the redundant options from my webpack.config and now it runs.

Joe Dalton
  • 346
  • 1
  • 9