Reactjs 物料界面的打字脚本错误';s CardActionArea组件属性

Reactjs 物料界面的打字脚本错误';s CardActionArea组件属性,reactjs,typescript,material-ui,react-router-dom,Reactjs,Typescript,Material Ui,React Router Dom,材料ui文档说明,我们需要使适配器将react router dom/Link组件封装到按钮中。但对CardActionArea执行相同操作(根据文档,这是一个基本按钮)会产生以下类型脚本错误: main.tsx:24:10 - error TS2322: Type '{ children: Element; component: ForwardRefExoticComponent<LinkProps & RefAttributes<HTMLAnchorElement>

材料ui文档说明,我们需要使适配器将
react router dom/Link
组件封装到按钮中。但对
CardActionArea
执行相同操作(根据文档,这是一个基本按钮)会产生以下类型脚本错误:

main.tsx:24:10 - error TS2322: Type '{ children: Element; component: ForwardRefExoticComponent<LinkProps & RefAttributes<HTMLAnchorElement>>; to: string; }' is not assignable to type 'IntrinsicAttributes & CardActionAreaProps & { children?: ReactNode; }'.
  Property 'component' does not exist on type 'IntrinsicAttributes & CardActionAreaProps & { children?: ReactNode; }'.

14         <CardActionArea component={AdapterLink} to="/foo">
            ~~~~~~~~~~~~~~
main.tsx:24:10-错误TS2322:类型“{children:Element;component:ForwardRefExoticComponent;to:string;}”不能分配给类型“intrinsicattAttributes&CardActionAreaProps&{children?:ReactNode;}”。
属性“component”在类型“IntrinsicatAttributes&CardActionAreaProps&{children?:ReactNode;}”上不存在。
14
~~~~~~~~~~~~~~
尽管如此,代码仍然有效。下面是显示第14行错误消息的最小示例:

注意:第6行有一个错误,因为Codesandbox在一个TypeScript文件中运行eslint,所以忽略它


这对我有效,而且我的打字脚本中没有错误:

<CardActionArea {...{ component: Link, to }}>

当我发布这个问题时,我使用的是MaterialUIV4.0.1,它有一个bug。在v4.0.2版本上,错误已经修复,但我仍然使用v4.0.1。我将把这个标记为答案!谢谢