From 7c21b1b9b615f59da30e945dc13ef1d72eb432c4 Mon Sep 17 00:00:00 2001 From: SrIzan10 <66965250+SrIzan10@users.noreply.github.com> Date: Wed, 16 Apr 2025 14:27:30 +0200 Subject: [PATCH] revert: "chore: ref codemod from react" This reverts commit efa082f62332fa24519a0b99f23cdb52da32cd3f. --- src/components/ui/avatar.tsx | 81 ++++----- src/components/ui/breadcrumb.tsx | 105 +++++------ src/components/ui/button.tsx | 40 ++--- src/components/ui/card.tsx | 142 +++++++-------- src/components/ui/checkbox.tsx | 39 ++-- src/components/ui/command.tsx | 196 +++++++++----------- src/components/ui/dialog.tsx | 123 ++++++------- src/components/ui/dropdown-menu.tsx | 270 +++++++++++++--------------- src/components/ui/form.tsx | 75 +++----- src/components/ui/input-otp.tsx | 79 ++++---- src/components/ui/input.tsx | 35 ++-- src/components/ui/label.tsx | 22 +-- src/components/ui/popover.tsx | 39 ++-- src/components/ui/table.tsx | 212 ++++++++++------------ src/components/ui/tabs.tsx | 87 ++++----- src/components/ui/textarea.tsx | 15 +- src/components/ui/tooltip.tsx | 32 ++-- 17 files changed, 698 insertions(+), 894 deletions(-) diff --git a/src/components/ui/avatar.tsx b/src/components/ui/avatar.tsx index e8d8e30..51e507b 100644 --- a/src/components/ui/avatar.tsx +++ b/src/components/ui/avatar.tsx @@ -5,55 +5,46 @@ import * as AvatarPrimitive from "@radix-ui/react-avatar" import { cn } from "@/lib/utils" -const Avatar = ( - { - ref, - className, - ...props - }: React.ComponentPropsWithoutRef & { - ref: React.RefObject>; - } -) => () +const Avatar = React.forwardRef< + React.ElementRef, + React.ComponentPropsWithoutRef +>(({ className, ...props }, ref) => ( + +)) Avatar.displayName = AvatarPrimitive.Root.displayName -const AvatarImage = ( - { - ref, - className, - ...props - }: React.ComponentPropsWithoutRef & { - ref: React.RefObject>; - } -) => () +const AvatarImage = React.forwardRef< + React.ElementRef, + React.ComponentPropsWithoutRef +>(({ className, ...props }, ref) => ( + +)) AvatarImage.displayName = AvatarPrimitive.Image.displayName -const AvatarFallback = ( - { - ref, - className, - ...props - }: React.ComponentPropsWithoutRef & { - ref: React.RefObject>; - } -) => () +const AvatarFallback = React.forwardRef< + React.ElementRef, + React.ComponentPropsWithoutRef +>(({ className, ...props }, ref) => ( + +)) AvatarFallback.displayName = AvatarPrimitive.Fallback.displayName export { Avatar, AvatarImage, AvatarFallback } diff --git a/src/components/ui/breadcrumb.tsx b/src/components/ui/breadcrumb.tsx index b32a52e..60e6c96 100644 --- a/src/components/ui/breadcrumb.tsx +++ b/src/components/ui/breadcrumb.tsx @@ -4,55 +4,47 @@ import { ChevronRight, MoreHorizontal } from "lucide-react" import { cn } from "@/lib/utils" -const Breadcrumb = ( - { - ref, - ...props +const Breadcrumb = React.forwardRef< + HTMLElement, + React.ComponentPropsWithoutRef<"nav"> & { + separator?: React.ReactNode } -) =>