Files
react/fixtures/stacks/BabelClasses-compiled.js
T
Jan KassensandGitHub 6b30832666 Upgrade prettier (#26081)
The old version of prettier we were using didn't support the Flow syntax
to access properties in a type using `SomeType['prop']`. This updates
`prettier` and `rollup-plugin-prettier` to the latest versions.

I added the prettier config `arrowParens: "avoid"` to reduce the diff
size as the default has changed in Prettier 2.0. The largest amount of
changes comes from function expressions now having a space. This doesn't
have an option to preserve the old behavior, so we have to update this.
2023-01-31 08:25:05 -05:00

81 lines
1.8 KiB
JavaScript

function _assertThisInitialized(self) {
if (self === void 0) {
throw new ReferenceError(
"this hasn't been initialised - super() hasn't been called"
);
}
return self;
}
function _defineProperty(obj, key, value) {
if (key in obj) {
Object.defineProperty(obj, key, {
value: value,
enumerable: true,
configurable: true,
writable: true,
});
} else {
obj[key] = value;
}
return obj;
}
function _inheritsLoose(subClass, superClass) {
subClass.prototype = Object.create(superClass.prototype);
subClass.prototype.constructor = subClass;
subClass.__proto__ = superClass;
}
// Compile this with Babel.
// babel --config-file ./babel.config.json BabelClasses.js --out-file BabelClasses-compiled.js --source-maps
let BabelClass = /*#__PURE__*/ (function (_React$Component) {
_inheritsLoose(BabelClass, _React$Component);
function BabelClass() {
return _React$Component.apply(this, arguments) || this;
}
var _proto = BabelClass.prototype;
_proto.render = function render() {
return this.props.children;
};
return BabelClass;
})(React.Component);
let BabelClassWithFields = /*#__PURE__*/ (function (_React$Component2) {
_inheritsLoose(BabelClassWithFields, _React$Component2);
function BabelClassWithFields(...args) {
var _this;
_this = _React$Component2.call(this, ...args) || this;
_defineProperty(
_assertThisInitialized(_assertThisInitialized(_this)),
'props',
void 0
);
_defineProperty(
_assertThisInitialized(_assertThisInitialized(_this)),
'state',
{}
);
return _this;
}
var _proto2 = BabelClassWithFields.prototype;
_proto2.render = function render() {
return this.props.children;
};
return BabelClassWithFields;
})(React.Component);
//# sourceMappingURL=BabelClasses-compiled.js.map