Last active
October 14, 2015 01:03
-
-
Save tribou/4ce53456f6acfa92e5dd to your computer and use it in GitHub Desktop.
A sample React component before migrating to ES6
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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