Skip to content

Commit

Permalink
fix: extendVariants forwardRef return type
Browse files Browse the repository at this point in the history
  • Loading branch information
shlyamster committed Dec 9, 2024
1 parent 09dba4c commit 77c5ac4
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions packages/core/system-rsc/src/extend-variants.d.ts
Original file line number Diff line number Diff line change
@@ -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<S> = {
[K in keyof S]?: ClassValue;
Expand Down Expand Up @@ -90,13 +96,13 @@ export type ExtendVariants = {
slots?: S;
},
opts?: Options,
): ForwardRefRenderFunction<
ReactElement<any>,
{
): ForwardRefExoticComponent<
PropsWithoutRef<{
[key in keyof CP | keyof V]?:
| (key extends keyof CP ? CP[key] : never)
| (key extends keyof V ? StringToBoolean<keyof V[key]> : never);
}
}> &
RefAttributes<ReactElement>
>;
};

Expand Down

0 comments on commit 77c5ac4

Please sign in to comment.