Open mdodge-ecgrow opened 1 year ago
@mdodge-ecgrow Your type for the position property is string but, the style property has the type position as Position | undefined, change your type or use CSSProperties
type ThumbVerticalBaseStyles = {
backgroundColor: string;
borderRadius: string;
cursor: string;
display: string;
height: string;
**position: string;**
};
type ThumbVerticalBaseStyles = React.CSSProperties;
I'm struggling here to figure out the correct types for the style object that gets passed to
renderThumbVertical
. This is my current code:Now on that line
return <div style={finalStyle} {...props} />;
, I am getting the following error:TS2322: Type '{ visibility: string; backgroundColor: string; borderRadius: string; cursor: string; display: string; height: string; position: string; }' is not assignable to type 'Properties<string | number, string & {}>'. Types of property 'position' are incompatible. Type 'string' is not assignable to type 'Position | undefined'. index.d.ts(1850, 9): The expected type comes from property 'style' which is declared here on type 'DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>'