Skip to content

Instantly share code, notes, and snippets.

@epmatsw
Created November 5, 2015 16:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save epmatsw/350777c3731de0f77fba to your computer and use it in GitHub Desktop.
Save epmatsw/350777c3731de0f77fba to your computer and use it in GitHub Desktop.
(function() {
var extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; },
hasProp = {}.hasOwnProperty;
define(['react'], function(React) {
var Test;
Test = (function(superClass) {
extend(Test, superClass);
function Test() {
return Test.__super__.constructor.apply(this, arguments);
}
Test.prototype.propTypes = {
items: React.PropTypes.arrayOf(React.propTypes.shape({
title: React.PropTypes.node
}))
};
Test.prototype.renderCell = function(item, index) {
return React.createElement("td", {
"key": index
}, item.title);
};
Test.prototype.render = function() {
return React.createElement("tr", null, this.props.items.map(this.renderCell));
};
return Test;
})(React.Component);
Test.displayName = 'Test';
return Test;
});
}).call(this);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment