I am using material-ui as a UI framework and I am trying to create a view with two buttons that have different values.
render: function() {
return
<Card>
<CardMedia overlay={<CardTitle title={this.props.title} />}>
<img src={this.props.image}/>
</CardMedia>
<CardActions>
<FlatButton onClick={this._handleClick} label="Good"/>
<FlatButton onClick={this._handleClick} label="Bad"/>
</CardActions>
</Card>
Since I am new to react I think that I miss something basic. How can I pass values to FlatButton, can I use the "ref" attribute? My main problem is that I am using a framework. If I had written those components I would just use props, such as "label" and handle the click event from the component itself.
Update: found a solution, but still if feels like an anti-pattern...
<FlatButton onClick={this._handleClick.bind(this, 1)} label="Good"/>
<FlatButton onClick={this._handleClick.bind(this, 0)} label="Bad"/>
Appreciate the help...