-
Notifications
You must be signed in to change notification settings - Fork 49.7k
Closed
Description
Was trying the beta version and noticed:
class Counter extends React.Component {
static propTypes = { initialCount: React.PropTypes.number };
static defaultProps = { initialCount: 0 };
state = { count: this.props.initialCount };
tick = () => this.setState({ count: this.state.count + 1 });
render = () => {
return (
<div onClick={this.tick()}>
Clicks: {this.state.count}
</div>
);
}
}Would bomb on jsx --harmony with Parse Error: Unexpected token =
AFAIK, new on a arrow function definitions will throw an error is not a constructor and it doesn't have a prototype as well, so I guess it can't be used with class...
//cc @sebmarkbage
Metadata
Metadata
Assignees
Labels
No labels