mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-17 00:55:32 -05: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:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user