-
-
Notifications
You must be signed in to change notification settings - Fork 10.7k
Closed
Description
Version
6.0.0-beta.0
Test Case
function ListItemLinkUnStyled({ nested, ...props }: LinkProps & ListItemProps & { nested?: boolean; to: string }) {
return <MuiListItem button component={Link} selected={!!useMatch(props.to)} {...props} />
}
Expected Behavior
working fine
Actual Behavior
The compont={Link}
get a ts error
The last overload gave the following error.
Type '{ replace?: boolean | undefined; state?: State | undefined; to: To & string; className?: string | undefined; style?: CSSProperties | undefined; slot?: string | undefined; ... 276 more ...; component: ForwardRefExoticComponent<...>; }' is not assignable to type 'IntrinsicAttributes & { button: true; } & { alignItems?: "flex-start" | "center" | undefined; autoFocus?: boolean | undefined; children?: ReactNode; ... 8 more ...; sx?: SxProps<...> | undefined; } & Omit<...> & CommonProps & Pick<...>'.
Property 'component' does not exist on type 'IntrinsicAttributes & { button: true; } & { alignItems?: "flex-start" | "center" | undefined; autoFocus?: boolean | undefined; children?: ReactNode; ... 8 more ...; sx?: SxProps<...> | undefined; } & Omit<...> & CommonProps & Pick<...>'.
Here is working fine in v5 version, I checked the code and found that the type definition of Link in v6 is different from that in v5
Metadata
Metadata
Assignees
Labels
No labels