parent
72bb1d3dec
commit
80a16de570
|
@ -8363,14 +8363,12 @@ namespace ts {
|
|||
checkGrammarJsxElement(node);
|
||||
checkJsxPreconditions(node);
|
||||
|
||||
// If we're compiling under --jsx react, the symbol 'React' should
|
||||
// be marked as 'used' so we don't incorrectly elide its import. And if there
|
||||
// is no 'React' symbol in scope, we should issue an error.
|
||||
if (compilerOptions.jsx === JsxEmit.React) {
|
||||
const reactSym = resolveName(node.tagName, "React", SymbolFlags.Value, Diagnostics.Cannot_find_name_0, "React");
|
||||
if (reactSym) {
|
||||
getSymbolLinks(reactSym).referenced = true;
|
||||
}
|
||||
// The symbol 'React' should be marked as 'used' so we don't incorrectly elide its import. And if there
|
||||
// is no 'React' symbol in scope when targeting React emit, we should issue an error.
|
||||
const reactRefErr = compilerOptions.jsx === JsxEmit.React ? Diagnostics.Cannot_find_name_0 : undefined;
|
||||
const reactSym = resolveName(node.tagName, "React", SymbolFlags.Value, reactRefErr, "React");
|
||||
if (reactSym) {
|
||||
getSymbolLinks(reactSym).referenced = true;
|
||||
}
|
||||
|
||||
const targetAttributesType = getJsxElementAttributesType(node);
|
||||
|
|
|
@ -34,7 +34,7 @@ module M {
|
|||
|
||||
|
||||
//// [test.jsx]
|
||||
define(["require", "exports", 'react-router'], function (require, exports, ReactRouter) {
|
||||
define(["require", "exports", 'react', 'react-router'], function (require, exports, React, ReactRouter) {
|
||||
"use strict";
|
||||
var Route = ReactRouter.Route;
|
||||
var routes1 = <Route />;
|
||||
|
|
Loading…
Reference in a new issue