Skip to content

Instantly share code, notes, and snippets.

@tribou
Last active October 14, 2015 01:03
Show Gist options
  • Save tribou/4ce53456f6acfa92e5dd to your computer and use it in GitHub Desktop.
Save tribou/4ce53456f6acfa92e5dd to your computer and use it in GitHub Desktop.
A sample React component before migrating to ES6
var React = require('react');
var TodoActions = require('../actions/TodoActions.js');
module.exports = React.createClass({
render: function() {
return(
<tr>
<td>{this.props.item}</td>
<td>
<button
type="button"
onClick={this._delete}
className="btn btn-link pull-right">
<span
className="glyphicon glyphicon-remove"
aria-hidden="true">
</span>
</button>
</td>
</tr>
)
},
_delete: function() {
TodoActions.removeItem(this.props.index);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment