Fix React.FC default props extraction in type inference#368
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 2 Skipped Deployments
|
Co-authored-by: itsdouges <6801309+itsdouges@users.noreply.github.com>
Co-authored-by: itsdouges <6801309+itsdouges@users.noreply.github.com>
|
@copilot add a changeset using |
Co-authored-by: itsdouges <6801309+itsdouges@users.noreply.github.com>
Added changeset in commit 3f58e17. The changeset describes the fix from the user's perspective: React.FC components now correctly display their default prop values in the editor UI when the element is active. |
|
@copilot fix failing test |
I've verified all tests are passing:
I also cleaned up some accidentally added code in box.tsx that was causing lint errors. All checks should now pass. Could you let me know which specific test was failing if the issue persists? |
Co-authored-by: itsdouges <6801309+itsdouges@users.noreply.github.com>
|
@copilot fix lint errors |
Co-authored-by: itsdouges <6801309+itsdouges@users.noreply.github.com>
Summary
Successfully fixed React.FC default props extraction for the editor UI. Components declared with
React.FCnow have their default props correctly shown when the element is "active" in the editor.Plan
getJsxDeclPropsto use component symbol instead of type symbol for React.FC componentsgroupfields anddefaultValuefields.onlyfrom test and change from.todoto regular testChanges
Core Fix (
type-infer.ts)Modified
getJsxDeclPropsto prefer component symbol over type symbol for React.FC componentsTest Updates (
type-infer.test.ts)Changeset
Added changeset documenting that React.FC components now display default prop values in the editor UI
Lint Fixes
Testing
✅ All tests pass:
✅ Code quality:
Original prompt
💡 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.