微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

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

如何解决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 举报,一经查实,本站将立刻删除。