Skip to content

fix: use ComponentPropsWithoutRef for intrinsic HTML elements#2

Open
markimbriaco wants to merge 1 commit intodancer:mainfrom
markimbriaco:fix/use-component-props-without-ref
Open

fix: use ComponentPropsWithoutRef for intrinsic HTML elements#2
markimbriaco wants to merge 1 commit intodancer:mainfrom
markimbriaco:fix/use-component-props-without-ref

Conversation

@markimbriaco
Copy link
Copy Markdown

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

  • input.tsx — with
  • textarea.tsx — with
  • breadcrumb.tsx — non-ref components with
  • pagination.tsx — mixed and non-ref components
  • chart.tsx — components with
  • sidebar.tsx — 20 intrinsic element type annotations

Component types (, , etc.) are intentionally left unchanged since is correct for extracting component prop types.

Impact

  • Zero functional changes
  • No breaking changes
  • Aligns with React TypeScript best practices and shadcn/ui conventions

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.
@vercel
Copy link
Copy Markdown

vercel bot commented Apr 9, 2026

@markimbriaco is attempting to deploy a commit to the Anniversary Team on Vercel.

A member of the Team first needs to authorize it.

@markimbriaco
Copy link
Copy Markdown
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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant