score:1

you can also do:

handleclick() {
   // code here
}

score:6

you get the error because class properties (class example { myproperty = 'foobar' }) is not a part of the language yet.

you need to add either a babel plugin or preset for it to work. you could use the stage 2 preset.

.babelrc

{
  "presets": [
    "react",
    "env"
    "stage-2"
  ]
}

Related Query

More Query from same tag