(tag: ts.JsxTagNameExpression, nodeTypeStr: string, output: JSXOutputState)
| 759 | } |
| 760 | |
| 761 | private getJsxNodeKind(tag: ts.JsxTagNameExpression, nodeTypeStr: string, output: JSXOutputState): JSXNodeKind { |
| 762 | if (ts.isIdentifier(tag)) { |
| 763 | const isIntrinsic = nodeTypeStr[0].toLowerCase() === nodeTypeStr[0]; |
| 764 | if (isIntrinsic) { |
| 765 | if (nodeTypeStr === 'slot') { |
| 766 | return JSXNodeKind.slot; |
| 767 | } else { |
| 768 | if (nodeTypeStr === 'slotted') { |
| 769 | this.onError(tag, '"slotted" elements must be direct children of components'); |
| 770 | } |
| 771 | return JSXNodeKind.element; |
| 772 | } |
| 773 | } |
| 774 | } |
| 775 | |
| 776 | if (tag.kind === ts.SyntaxKind.JsxNamespacedName) { |
| 777 | this.onError(tag, 'JSX Namespaced Names are not supported'); |
| 778 | } |
| 779 | |
| 780 | const resolvedType = resolveTypeOfExpression(tag, output.typeChecker); |
| 781 | |
| 782 | const symbol = resolvedType.effectiveObjectInfo?.symbol; |
| 783 | if ((symbol && symbol.flags & ts.SymbolFlags.Function) || resolvedType.effectiveType === SymbolType.function) { |
| 784 | return JSXNodeKind.functionComponent; |
| 785 | } |
| 786 | |
| 787 | // Consider any expressions as constructors |
| 788 | return JSXNodeKind.component; |
| 789 | } |
| 790 | |
| 791 | private outputJSXElement( |
| 792 | jsxElement: JSXElement, |
no test coverage detected