mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-30 01:04:49 -05:00
Fix React whitespace emit #4376
This commit is contained in:
@@ -6463,7 +6463,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi
|
||||
|
||||
function trimReactWhitespace(node: JsxText): string {
|
||||
let result: string = undefined;
|
||||
let text = getTextOfNode(node);
|
||||
let text = getTextOfNode(node, true);
|
||||
let firstNonWhitespace = 0;
|
||||
let lastNonWhitespace = -1;
|
||||
|
||||
@@ -6498,7 +6498,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi
|
||||
switch (compilerOptions.jsx) {
|
||||
case JsxEmit.React:
|
||||
let text = trimReactWhitespace(node);
|
||||
if (text.length === 0) {
|
||||
if (text === undefined || text.length === 0) {
|
||||
return undefined;
|
||||
}
|
||||
else {
|
||||
|
||||
Reference in New Issue
Block a user