mirror of
https://github.com/i701/sarlink-portal.git
synced 2025-07-15 17:15:50 +00:00
refactor: simplify FloatingInput and Textarea components by removing unnecessary forwardRef usage 🔨
This commit is contained in:
@ -3,9 +3,7 @@ import { Input } from '@/components/ui/input';
|
||||
import { Label } from '@/components/ui/label';
|
||||
import { cn } from '@/lib/utils';
|
||||
|
||||
export interface InputProps extends React.InputHTMLAttributes<HTMLInputElement> { }
|
||||
|
||||
const FloatingInput = React.forwardRef<HTMLInputElement, InputProps>(
|
||||
const FloatingInput = React.forwardRef<HTMLInputElement, React.InputHTMLAttributes<HTMLInputElement>>(
|
||||
({ className, ...props }, ref) => {
|
||||
return <Input placeholder=" " className={cn('peer', className)} ref={ref} {...props} />;
|
||||
},
|
||||
@ -29,7 +27,7 @@ const FloatingLabel = React.forwardRef<
|
||||
});
|
||||
FloatingLabel.displayName = 'FloatingLabel';
|
||||
|
||||
type FloatingLabelInputProps = InputProps & { label?: string };
|
||||
type FloatingLabelInputProps = React.InputHTMLAttributes<HTMLInputElement> & { label?: string };
|
||||
|
||||
const FloatingLabelInput = React.forwardRef<
|
||||
React.ElementRef<typeof FloatingInput>,
|
||||
|
Reference in New Issue
Block a user