[WIP] react class components from ternaries give no construct or call signature upon rendering #1445
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.
Working on fixing the issue where JSX elements with union types of React class components result in "no construct or call signatures" error.
Progress:
internal/checker/jsx.go
jsxUnionNoSignatures.tsx
- confirms TS2604 error can be triggeredjsxUnionWithNonCallable.tsx
- reproduces TS2604 with mixed valid/invalid unionjsxValidConstructorUnion.tsx
- shows that valid constructor unions workgetUninstantiatedJsxSignaturesOfType
functionIssue Analysis:
The
getUninstantiatedJsxSignaturesOfType
function correctly handles:The issue appears to be specific to React class components. Further investigation needed to understand why class constructor types might not be detected as having construct signatures in certain contexts.
Test Results:
Fixes #1442.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.