mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-14 19:16:17 -06:00
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:
parent
8e6467cdb8
commit
202093a730
@ -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;
|
||||
}
|
||||
|
||||
|
||||
@ -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 })
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user