Ensure factory symbol remains unused in react-jsx mode when not referenced in user code (#41905)

This commit is contained in:
Wesley Wigham
2020-12-16 13:11:48 -08:00
committed by GitHub
parent 4b8b0c861e
commit 675cd4d7ce
10 changed files with 184 additions and 0 deletions

View File

@@ -26955,6 +26955,9 @@ namespace ts {
errorOutputContainer);
function checkTagNameDoesNotExpectTooManyArguments(): boolean {
if (getJsxNamespaceContainerForImplicitImport(node)) {
return true; // factory is implicitly jsx/jsxdev - assume it fits the bill, since we don't strongly look for the jsx/jsxs/jsxDEV factory APIs anywhere else (at least not yet)
}
const tagType = isJsxOpeningElement(node) || isJsxSelfClosingElement(node) && !isJsxIntrinsicIdentifier(node.tagName) ? checkExpression(node.tagName) : undefined;
if (!tagType) {
return true;