Skip to content

Commit cc1947b

Browse files
committed
Rename jsxNamespace to reactNamespace
1 parent c0b28a3 commit cc1947b

5 files changed

Lines changed: 10 additions & 10 deletions

File tree

src/compiler/checker.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8360,11 +8360,11 @@ namespace ts {
83608360
checkGrammarJsxElement(node);
83618361
checkJsxPreconditions(node);
83628362

8363-
// The symbol 'React' should be marked as 'used' so we don't incorrectly elide its import. And if there
8364-
// is no 'React' symbol in scope when targeting React emit, we should issue an error.
8363+
// The reactNamespace symbol should be marked as 'used' so we don't incorrectly elide its import. And if there
8364+
// is no reactNamespace symbol in scope when targeting React emit, we should issue an error.
83658365
const reactRefErr = compilerOptions.jsx === JsxEmit.React ? Diagnostics.Cannot_find_name_0 : undefined;
8366-
const jsxNamespace = compilerOptions.jsxNamespace ? compilerOptions.jsxNamespace : "React";
8367-
const reactSym = resolveName(node.tagName, jsxNamespace, SymbolFlags.Value, reactRefErr, jsxNamespace);
8366+
const reactNamespace = compilerOptions.reactNamespace ? compilerOptions.reactNamespace : "React";
8367+
const reactSym = resolveName(node.tagName, reactNamespace, SymbolFlags.Value, reactRefErr, reactNamespace);
83688368
if (reactSym) {
83698369
getSymbolLinks(reactSym).referenced = true;
83708370
}

src/compiler/commandLineParser.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,9 @@ namespace ts {
5555
error: Diagnostics.Argument_for_jsx_must_be_preserve_or_react
5656
},
5757
{
58-
name: "jsxNamespace",
58+
name: "reactNamespace",
5959
type: "string",
60-
description: Diagnostics.Specify_JSX_emit_namespace_when_JSX_code_generation_mode_is_react
60+
description: Diagnostics.Specifies_the_object_invoked_for_createElement_and_spread_when_targeting_react_JSX_emit
6161
},
6262
{
6363
name: "listFiles",

src/compiler/diagnosticMessages.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2393,9 +2393,9 @@
23932393
"category": "Message",
23942394
"code": 6083
23952395
},
2396-
"Specify JSX emit namespace when JSX code generation mode is 'react'": {
2396+
"Specifies the object invoked for createElement and __spread when targeting 'react' JSX emit": {
23972397
"category": "Message",
2398-
"code": 6084
2398+
"code": 6084
23992399
},
24002400

24012401
"Variable '{0}' implicitly has an '{1}' type.": {

src/compiler/emitter.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1186,7 +1186,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, Promi
11861186

11871187
function emitJsxElement(openingNode: JsxOpeningLikeElement, children?: JsxChild[]) {
11881188
const syntheticReactRef = <Identifier>createSynthesizedNode(SyntaxKind.Identifier);
1189-
syntheticReactRef.text = compilerOptions.jsxNamespace ? compilerOptions.jsxNamespace : "React";
1189+
syntheticReactRef.text = compilerOptions.reactNamespace ? compilerOptions.reactNamespace : "React";
11901190
syntheticReactRef.parent = openingNode;
11911191

11921192
// Call React.createElement(tag, ...

src/compiler/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2382,7 +2382,7 @@ namespace ts {
23822382
inlineSourceMap?: boolean;
23832383
inlineSources?: boolean;
23842384
jsx?: JsxEmit;
2385-
jsxNamespace? : string;
2385+
reactNamespace?: string;
23862386
listFiles?: boolean;
23872387
locale?: string;
23882388
mapRoot?: string;

0 commit comments

Comments
 (0)