I am using react mui MenuItem and I need to make a menu item as a link. I have tried to that like this:
<MenuItem
component={<Link href={`/backend/api/exam/${row.id}/result`} />}
className={classes.menuItem}
onClick={() => handleClose()}>
Result
</MenuItem>
But, when I do that, it throws an error where it says that property component does not exist on MenuItem:
Property 'component' does not exist on type 'IntrinsicAttributes & { action?: ((instance: ButtonBaseActions | null) => void) | RefObject | null | undefined; buttonRef?: ((instance: unknown) => void) | RefObject | null | undefined; ... 7 more ...; TouchRippleProps?: Partial<...> | undefined; } & { ...; } & { ...; } & CommonProps<...>...'. TS2322
What am I doing wrong here, why do I get this error?