score:3

ok, i have seemed to solve my own issue here. first i needed to edit my .babelrc file to

{
  "presets": [
    ["es2016"],
    "react"
  ],
  "plugins": [
    "babel-plugin-transform-class-properties"
  ]
}

obviously installing the babel-plugin-transform-class-properties plugin and babel-preset-es2016, then things seem to compile and work more like i expected.

score:3

arrow functions that are members of a class are not included yet. you need to install babel-transform-class-properties.

run this command:

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

and create a .babelrc file in the root directory of your project if doesn't exist an add this

{
  "plugins": ["transform-class-properties"]
}

or if you need to add some options

{
  "plugins": [
    ["transform-class-properties", { "spec": true }]
  ]
}

Related Query

More Query from same tag