From 77c5ac446cf0d4a7ea4713dde2c851a96c3b46ff Mon Sep 17 00:00:00 2001 From: shlyamster <25763635+shlyamster@users.noreply.github.com> Date: Mon, 9 Dec 2024 15:03:35 +0400 Subject: [PATCH] fix: extendVariants forwardRef return type --- .../core/system-rsc/src/extend-variants.d.ts | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/packages/core/system-rsc/src/extend-variants.d.ts b/packages/core/system-rsc/src/extend-variants.d.ts index 65568b7e8d..d4f1a80e17 100644 --- a/packages/core/system-rsc/src/extend-variants.d.ts +++ b/packages/core/system-rsc/src/extend-variants.d.ts @@ -1,5 +1,11 @@ import type {ClassValue, StringToBoolean, OmitUndefined, ClassProp} from "tailwind-variants"; -import type {ForwardRefRenderFunction, JSXElementConstructor, ReactElement} from "react"; +import type { + ForwardRefExoticComponent, + JSXElementConstructor, + PropsWithoutRef, + ReactElement, + RefAttributes, +} from "react"; type SlotsClassValue = { [K in keyof S]?: ClassValue; @@ -90,13 +96,13 @@ export type ExtendVariants = { slots?: S; }, opts?: Options, - ): ForwardRefRenderFunction< - ReactElement, - { + ): ForwardRefExoticComponent< + PropsWithoutRef<{ [key in keyof CP | keyof V]?: | (key extends keyof CP ? CP[key] : never) | (key extends keyof V ? StringToBoolean : never); - } + }> & + RefAttributes >; };