FluentUI数据列表组示例打字稿错误

问题描述

我将以下示例复制到这里:https://developer.microsoft.com/de-de/fluentui#/controls/web/detailslist/grouped到本地计算机(此代码https://dpaste.org/rJ8k,即使我没有进行任何更改,我也遇到L. 150和154错误错误是:

Type '(props: IDetailsHeaderProps,_defaultRender?: IRenderFunction<IDetailsHeaderProps> | undefined) => Element' is not assignable to type 'IRenderFunction<IDetailsHeaderProps>'.
  Types of parameters 'props' and 'props' are incompatible.
    Type 'IDetailsHeaderProps | undefined' is not assignable to type 'IDetailsHeaderProps'.
      Type 'undefined' is not assignable to type 'IDetailsHeaderProps'
The expected type comes from property 'onRenderDetailsHeader' which is declared here on type 'IntrinsicAttributes & IDetailsListProps & { children?: ReactNode; }'

Type '(item: IDetailsListGroupedExampleItem,index: number,column: IColumn) => Element' is not assignable to type '(item?: any,index?: number | undefined,column?: IColumn | undefined) => ReactNode'.
  Types of parameters 'index' and 'index' are incompatible.
    Type 'number | undefined' is not assignable to type 'number'.
      Type 'undefined' is not assignable to type 'number'
The expected type comes from property 'onRenderItemColumn' which is declared here on type 'IntrinsicAttributes & IDetailsListProps & { children?: ReactNode; }'

我正在使用TS版本3.7.5并做出16.13.1的响应-使用CRA创建。 可能是因为应用程序中使用了严格的null类型而fluentUI不是用严格的null类型构建的吗?

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)