variant-classnames
variant-classnames copied to clipboard
"VariantsOf" type incompatibility
Hi everyone,
I'm just trying this library and I'm looking at the TypeScript support.
When I try the example here https://github.com/mattvalleycodes/variant-classnames#nested-properties-auto-complete, TypeScript gives me an error:
TS2345: Argument of type 'VariantsOf<Props, $Hooks1<OmitType<Required<Props>, Function>>>' is not assignable to parameter of type 'RootVariations'. Type 'VariantsOf<Props, $Hooks1<OmitType<Required<Props>, Function>>>' is not assignable to type '{ $forward?: MaybeString; }'. Types of property '$forward' are incompatible. Type 'string | { [x: string]: string | VariantsOf<$Hooks1<Omit<$Hooks1<OmitType<Required<Props>, Function>>, "$forward">>, $Hooks1<...>> | undefined; } | undefined' is not assignable to type 'MaybeString'. Type '{ [x: string]: string | VariantsOf<$Hooks1<Omit<$Hooks1<OmitType<Required<Props>, Function>>, "$forward">>, $Hooks1<OmitType<Required<$Hooks1<Omit<$Hooks1<...>, "$forward">>>, Function>>> | undefined; }' is not assignable to type 'MaybeString'.
Library versions:
- variant-classnames: ^1.2.0
- react: 18.2.0
- typescript: 4.8.2
Can you help me with this issue?
Thank you.
@mertturkmenoglu Hi there; we're aware of this and will work on this to fix it. For the time being, I would recommend to use // @ts-ignore
cc @jhesgodi
Thank you @mattvalleycodes. Appreciate it.
Hey, neat little library. Any update on this issue?