diff --git a/src/compiler/commandLineParser.ts b/src/compiler/commandLineParser.ts index 56767b9420b6b..d971da3ad6bff 100644 --- a/src/compiler/commandLineParser.ts +++ b/src/compiler/commandLineParser.ts @@ -234,9 +234,9 @@ namespace ts { { name: "jsx", type: createMapFromTemplate({ + "react": JsxEmit.React, "preserve": JsxEmit.Preserve, "react-native": JsxEmit.ReactNative, - "react": JsxEmit.React }), affectsSourceFile: true, paramType: Diagnostics.KIND, diff --git a/src/compiler/transformer.ts b/src/compiler/transformer.ts index b78202e0c3d58..a5aa09a951006 100644 --- a/src/compiler/transformer.ts +++ b/src/compiler/transformer.ts @@ -25,7 +25,8 @@ namespace ts { } export function getTransformers(compilerOptions: CompilerOptions, customTransformers?: CustomTransformers) { - const jsx = compilerOptions.jsx; + const jsx = compilerOptions.jsx || JsxEmit.React; + const languageVersion = getEmitScriptTarget(compilerOptions); const moduleKind = getEmitModuleKind(compilerOptions); const transformers: TransformerFactory[] = [];