reactjs - parse error handleDismissClick = e => -


syntaxerror: /users/mumuhou/github/web/react/examples/basic-commonjs/index.js: unexpected token (7:21) while parsing file: /users/mumuhou/github/web/react/examples/basic-commonjs/index.js

my code:

'use strict';  import react, { component, proptypes } 'react' import reactdom 'react-dom'  class app extends component {   handledismissclick = e => {     e.preventdefault()   }    render() {     var elapsed = math.round(this.props.elapsed  / 100);     var seconds = elapsed / 10 + (elapsed % 10 ? '' : '.0' );     var message =       'react has been running ' + seconds + ' seconds.';      return <p>{message}</p>;   } }  var start = new date().gettime();  setinterval(function() {   reactdom.render(     <app elapsed={new date().gettime() - start} />,     document.getelementbyid('container')   ); }, 200); 

i have config es2015

class app extends component {   handledismissclick = e => {     e.preventdefault()   } } 

is public class fields proposal. in order babel understand , convert it, have load corresponding plugin, or use stage-2 preset.


Comments

Popular posts from this blog

php - How to display all orders for a single product showing the most recent first? Woocommerce -

asp.net - How to correctly use QUERY_STRING in ISAPI rewrite? -

angularjs - How restrict admin panel using in backend laravel and admin panel on angular? -