microsoft / microsoft/TypeScript
Code invalid when [jsx=react-jsx] and [module=system]
Offen
@weswigham arbeitet bereits daran.
Seit 10.12.2020.
Needs Investigation
Rescheduled
- Vorherrschende Sprache
- Go
- Sterne
- 111k
- Forks
- 14.3k
- Ø Merge
- 2 T. 4 Std.
- Gemergte PRs (30 T.)
- 132
Beschreibung
TypeScript Version: 4.2.0-dev.20201210
Search Terms: react-jsx react-jsxdev systemjs code generataion emit
Code
/** x.tsx
* compile with:
* tsc --moduleResolution node --lib esnext --jsx react-jsx --module system x.tsx
*/
import { PureComponent } from 'react';
export class ApplicationRoot extends PureComponent {
render() {
return <h1>Hello, React</h1>;
}
}
Actual behavior:
see "//// <<-- this is wrong" at the end
System.register(["react/jsx-runtime", "react"], function (exports_1, context_1) {
"use strict";
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
if (typeof b !== "function" && b !== null)
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
var jsx_runtime_1, react_1, ApplicationRoot;
var __moduleName = context_1 && context_1.id;
return {
setters: [
function (jsx_runtime_1_1) {
jsx_runtime_1 = jsx_runtime_1_1;
},
function (react_1_1) {
react_1 = react_1_1;
}
],
execute: function () {
ApplicationRoot = /** @class */ (function (_super) {
__extends(ApplicationRoot, _super);
function ApplicationRoot() {
return _super !== null && _super.apply(this, arguments) || this;
}
ApplicationRoot.prototype.render = function () {
return _jsx("h1", { children: "Hello, React" }, void 0); //// <<-- this is wrong
};
return ApplicationRoot;
}(react_1.PureComponent));
exports_1("ApplicationRoot", ApplicationRoot);
}
};
});
Expected behavior: I should be:
return jsx_runtime_1._jsx("h1", { children: "Hello, React" }, void 0);
Playground Link: playground seems down when I report this issue
Related Issues: None
Beitragsleitfaden
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Bewertung
Dieses Issue wurde noch nicht bewertet.