swc/tests/tsc-references/jsx/tsxSpreadAttributesResolution13x/input.tsx/es5.1.normal/output.js

37 lines
1.0 KiB
JavaScript

function _extends() {
_extends = Object.assign || function(target) {
for(var i = 1; i < arguments.length; i++){
var source = arguments[i];
for(var key in source){
if (Object.prototype.hasOwnProperty.call(source, key)) {
target[key] = source[key];
}
}
}
return target;
};
return _extends.apply(this, arguments);
}
// @filename: file.tsx
// @jsx: preserve
// @noLib: true
// @skipLibCheck: true
// @libFiles: react.d.ts,lib.d.ts
var React = require('react');
export default function Component(props) {
var condition1;
if (condition1) {
return(/*#__PURE__*/ React.createElement(ChildComponent, _extends({
}, props)));
} else {
return(/*#__PURE__*/ React.createElement(ChildComponent, _extends({
}, props, {
property1: "NewString"
})));
}
};
function ChildComponent(param) {
var property1 = param.property1;
return(/*#__PURE__*/ React.createElement("span", null, property1));
}