TypeScript Version: 3.0.3
Search Terms:
printNode JSX
printNode not printing JSX text
Code
const html = '<div>Text within a node</div>';
const jsxAst = ts.createSourceFile(
'test-file.tsx',
html,
ts.ScriptTarget.Latest,
false,
ts.ScriptKind.TSX,
);
const printer = ts.createPrinter({
newLine: ts.NewLineKind.LineFeed,
});
const result = printer.printNode(ts.EmitHint.Unspecified, jsxAst, jsxAst);
Expected behavior:
Value of the result variable should be the same as the html variable
Actual behavior:
result variable is <div></div>
TypeScript Version: 3.0.3
Search Terms:
printNode JSX
printNode not printing JSX text
Code
Expected behavior:
Value of the result variable should be the same as the html variable
Actual behavior:
result variable is <div></div>