Files
payload/templates/with-vercel-website/src/components/ui/input.tsx
Jacob Fletcher 47e8158d1e chore(templates): removes all instances of React.forwardRef (#10331)
Fixes #10325. Since React 19, refs can now be passed directly through
props without the need for `React.forwardRef`. This greatly simplifies
components types and overall syntax.
2025-01-03 17:39:31 +00:00

23 lines
742 B
TypeScript

import { cn } from 'src/utilities/cn'
import * as React from 'react'
const Input: React.FC<
{
ref?: React.Ref<HTMLInputElement>
} & React.InputHTMLAttributes<HTMLInputElement>
> = ({ type, className, ref, ...props }) => {
return (
<input
className={cn(
'flex h-10 w-full rounded border border-border bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50',
className,
)}
ref={ref}
type={type}
{...props}
/>
)
}
export { Input }