TypeScript help for the last version #1265
Unanswered
ionutcirja
asked this question in
Q&A
Replies: 1 comment 2 replies
-
Seems to work fine here: https://codesandbox.io/p/sandbox/xlgmrz. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
For the previous version of the library I was defining an item like this:
`export const Item: Components['Item'] = React.forwardRef<
HTMLDivElement,
ItemProps
Item.displayName = 'Item';`
But with the current version I'm getting this error:
src/components/live-shows/chat/virtuoso-components.tsx(22,14): error TS2322: Type 'ForwardRefExoticComponent<Pick<DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "children" | "style"> & { ...; } & RefAttributes<...>>' is not assignable to type 'ComponentType<Pick<DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "children" | "style"> & { ...; } & ContextProp<...>>'. Type 'ForwardRefExoticComponent<Pick<DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "children" | "style"> & { ...; } & RefAttributes<...>>' is not assignable to type 'FunctionComponent<Pick<DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "children" | "style"> & { ...; } & ContextProp<...>>'. Types of parameters 'props' and 'props' are incompatible. Type 'Pick<DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "children" | "style"> & { ...; } & ContextProp<...>' is not assignable to type 'Pick<DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "children" | "style"> & { ...; } & RefAttributes<...>'. Type 'Pick<DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "children" | "style"> & { ...; } & ContextProp<...>' is not assignable to type '{ 'data-index': number; 'data-item-group-index'?: number; 'data-item-index': number; 'data-known-size': number; item: Readonly<{ userId: string; displayName: string; date: number; content: string; disabled?: boolean; type: ChatMessageType; }>; }'. Types of property 'item' are incompatible. Type '{}' is missing the following properties from type 'Readonly<{ userId: string; displayName: string; date: number; content: string; disabled?: boolean; type: ChatMessageType; }>': userId, displayName, date, content, type
Does anyone know how to solve this?
Many thanks
Beta Was this translation helpful? Give feedback.
All reactions