When creating react namespace identifier, set its parent to jsx opening element in the parse tree

This helps in resolving the react identifier correctly and Fixes #11654
This commit is contained in:
Sheetal Nandi 2016-10-20 15:25:26 -07:00
parent 8e6467cdb8
commit 202093a730
2 changed files with 4 additions and 2 deletions

View File

@ -1625,7 +1625,9 @@ namespace ts {
// flag and setting a parent node.
const react = createIdentifier(reactNamespace || "React");
react.flags &= ~NodeFlags.Synthesized;
react.parent = parent;
// Set the parent that is in parse tree
// this makes sure that parent chain is intact for checker to traverse complete scope tree
react.parent = getParseTreeNode(parent);
return react;
}

View File

@ -75,7 +75,7 @@ class A {
view() {
return [
Element_1.Element.createElement("meta", { content: "helloworld" }),
Element.createElement("meta", { content: c.a.b })
Element_1.Element.createElement("meta", { content: c.a.b })
];
}
}