coffeescript
coffeescript copied to clipboard
V2 translate class has some issue
CoffeeScript version 2.0.2
App.coffee
class App extends React.Component
constructor: (@props)->
super props
render: ->
return (<div>Div</div>)
I use this command coffee --compile --bare --output src/ src/ got app.js
app.js
// Generated by CoffeeScript 2.0.2
var App;
App = class App extends React.Component {
constructor(props1) {
super(props); // here is the problem, Is it should be props1?
this.props = props1;
}
render() {
return <div>Div</div>;
}
};
Is it the super(props); should be props1?
That changed in 1.9.0 (Jan 2015).
Or what you meant to write was super @props, which isn't allowed because JavaScript doesn't permit it.
@GeoffreyBooth I was wrong, there should not be @