fix: use ComponentPropsWithoutRef for intrinsic HTML elements#2
Open
markimbriaco wants to merge 1 commit intodancer:mainfrom
Open
fix: use ComponentPropsWithoutRef for intrinsic HTML elements#2markimbriaco wants to merge 1 commit intodancer:mainfrom
markimbriaco wants to merge 1 commit intodancer:mainfrom
Conversation
Replace React.ComponentProps with React.ComponentPropsWithoutRef for all intrinsic HTML element types across 6 component files. ComponentProps includes the ref property in its type, which conflicts with forwardRef components that already manage refs separately via the first generic parameter. This causes duplicate ref types and incorrect inference in strict TypeScript configurations. Affected components: input, textarea, breadcrumb, pagination, chart, sidebar.
|
@markimbriaco is attempting to deploy a commit to the Anniversary Team on Vercel. A member of the Team first needs to authorize it. |
Author
|
Hey! Noticed the component type annotations for intrinsic HTML elements were using instead of . This causes a duplicate ref type when paired with since the ref is already handled by the first generic parameter. This is a pure type-level fix across 6 files — zero functional changes, just aligns with React best practices and the shadcn/ui convention. The Vercel check failure is just the deploy authorization gate for external contributors, not a code issue. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Replaces with for all intrinsic HTML element type annotations across 6 component files.
Problem
includes the property in its type. When used with , this creates a duplicate ref type since already manages refs via its first generic parameter. This can cause incorrect type inference in strict TypeScript configurations.
Changes
Component types (, , etc.) are intentionally left unchanged since is correct for extracting component prop types.
Impact