From d2aea2d4e7eff9aaa720a6d6b5ec3884daf94052 Mon Sep 17 00:00:00 2001 From: Yuneng Jiang Date: Tue, 25 Aug 2026 22:56:59 -0700 Subject: [PATCH] refactor(ui): re-pull label, textarea, separator and skeleton from the registry These four primitives still wrapped their body in React.forwardRef, which the dashboard has not needed since it moved to React 19: a function component receives ref as an ordinary prop and the existing {...props} spread already hands it to the DOM node. Re-pulling each from base-vega drops the wrapper and its displayName. These four were picked because the ref plumbing is their only divergence from current upstream, so the class strings, data-slot values and exports are untouched and nothing renders differently. The other seven primitives that still carry forwardRef have also drifted on their class strings, so re-pulling them would ship a visual change alongside the cleanup and they are left alone here. Textarea is the one with real ref call sites, roughly seventeen of them through react-hook-form's field.ref, and ref-forwarding.test.tsx did not cover it. Add that case next to the Label, Separator and Skeleton ones already there. --- ui/litellm-dashboard/src/components/ui/label.tsx | 10 ++++------ .../src/components/ui/ref-forwarding.test.tsx | 7 +++++++ ui/litellm-dashboard/src/components/ui/separator.tsx | 11 ++++------- ui/litellm-dashboard/src/components/ui/skeleton.tsx | 11 +++-------- ui/litellm-dashboard/src/components/ui/textarea.tsx | 10 ++++------ 5 files changed, 22 insertions(+), 27 deletions(-) diff --git a/ui/litellm-dashboard/src/components/ui/label.tsx b/ui/litellm-dashboard/src/components/ui/label.tsx index 1ac4eed0d4e..ded2dfc1a7b 100644 --- a/ui/litellm-dashboard/src/components/ui/label.tsx +++ b/ui/litellm-dashboard/src/components/ui/label.tsx @@ -4,10 +4,9 @@ import * as React from "react"; import { cn } from "@/lib/cva.config"; -const Label = React.forwardRef>( - ({ className, ...props }, ref) => ( +function Label({ className, ...props }: React.ComponentProps<"label">) { + return (