Unexpected Token after const Unexpected Token after const reactjs reactjs

Unexpected Token after const


You can't define a const in the class body like that; it should be moved into a method.

render() {  const title = (    <h3>Panel title</h3>  );  // ...}


Apparently, this is called "Public Class Field Syntax" and is already available in babel as the plugin, babel-plugin-transform-class-properties. I have not tried it as yet though.

Additional reference is reactjs.org events guide