Strongly typecheck unions of intrinsic tag names #28557
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This comment mentioned the change. The exact example given with
a
anddiv
tags won't work - they have props types ofDetailedHTMLFactory<AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement>
andDetailedHTMLFactory<HTMLAttributes<HTMLDivElement>, HTMLDivElement>
, respectively - neither one of which is a subtype of the other, so no union call can be made. However, this does allow similar elements to coexist in a union, egh1
andh2
orcaption
andcode
. Once we have a general fix for #7294, this change should also allow jsx intrinsics to light up alongside that.The change itself is just moving the
StringLiteral
andString
tag type handling logic insidegetUninstantiatedJsxSignaturesOfType
, so it applies to union members in addition to the top-level type.