We were using `Object.create` to setup the prototype chain at the start of the class definition, which lead to #7771. I was a bit worried about a speed hit, but it seems everyone optimizes the two patterns the same way. https://jsbench.github.io/#f9fca52407643d96458a35763b201215 Fixes #7771.
31 lines
845 B
JavaScript
31 lines
845 B
JavaScript
"use strict";
|
|
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.default = void 0;
|
|
|
|
var _react = babelHelpers.interopRequireDefault(require("react"));
|
|
|
|
var RandomComponent =
|
|
/*#__PURE__*/
|
|
function (_Component) {
|
|
function RandomComponent() {
|
|
babelHelpers.classCallCheck(this, RandomComponent);
|
|
return babelHelpers.possibleConstructorReturn(this, babelHelpers.getPrototypeOf(RandomComponent).call(this));
|
|
}
|
|
|
|
babelHelpers.createClass(RandomComponent, [{
|
|
key: "render",
|
|
value: function render() {
|
|
return _react.default.createElement("div", {
|
|
className: "sui-RandomComponent"
|
|
}, _react.default.createElement("h2", null, "Hi there!"));
|
|
}
|
|
}]);
|
|
babelHelpers.inherits(RandomComponent, _Component);
|
|
return RandomComponent;
|
|
}(_react.Component);
|
|
|
|
exports.default = RandomComponent;
|