From 151a56fc6631837569a2aac0926f64ff19392388 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Bombeck?= Date: Thu, 18 Jun 2026 18:47:19 +0200 Subject: [PATCH] refactor(ui): adopt the React 19 ref-as-prop idiom and the toJson helper MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Drop forwardRef from the textarea and native-select primitives — the last two holdouts under components/ui — so they accept ref as a plain prop like the input primitive already does. No call site passes a ref to either, and the React 19 prop path is the forward-looking shape. Route the inventory-consumption JSON-column write through the shared toJson helper instead of an inline `as unknown as Prisma.InputJsonValue` cast, keeping the WHY of the escape hatch in one place. --- src/components/ui/native-select.tsx | 13 +++++++------ src/components/ui/textarea.tsx | 17 ++++++++--------- src/lib/medications/inventory/consumption.ts | 3 ++- 3 files changed, 17 insertions(+), 16 deletions(-) diff --git a/src/components/ui/native-select.tsx b/src/components/ui/native-select.tsx index 97f7b33a9..5cfac9a66 100644 --- a/src/components/ui/native-select.tsx +++ b/src/components/ui/native-select.tsx @@ -59,13 +59,14 @@ const NATIVE_SELECT_CLASS = export type NativeSelectProps = React.SelectHTMLAttributes; -export const NativeSelect = React.forwardRef< - HTMLSelectElement, - NativeSelectProps ->(function NativeSelect({ className, children, style, ...props }, ref) { +export function NativeSelect({ + className, + children, + style, + ...props +}: NativeSelectProps) { return (