diff --git a/.changeset/twelve-ducks-thank.md b/.changeset/twelve-ducks-thank.md new file mode 100644 index 0000000000..ad8ba259a3 --- /dev/null +++ b/.changeset/twelve-ducks-thank.md @@ -0,0 +1,5 @@ +--- +"@nextui-org/system-rsc": patch +--- + +Fix data type returned by the extendVariants function (#4269) diff --git a/packages/core/system-rsc/src/extend-variants.d.ts b/packages/core/system-rsc/src/extend-variants.d.ts index 3ef30a7bee..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 >; };