Created
November 5, 2015 16:01
-
-
Save epmatsw/350777c3731de0f77fba to your computer and use it in GitHub Desktop.
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
(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