Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/typescript/8.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Reactjs 在react错误(2322)中创建选项卡时出现问题_Reactjs_Typescript - Fatal编程技术网

Reactjs 在react错误(2322)中创建选项卡时出现问题

Reactjs 在react错误(2322)中创建选项卡时出现问题,reactjs,typescript,Reactjs,Typescript,所以。。。我正在跟踪 并且得到了错误 类型“{children:Element;iconClassName:string;linkClassName:string;}”不可分配给类型“IntrinsicattAttributes&Props”。属性“children”不存在于类型“intrinsitattributes&Props”上。ts(2322) 在stackoverflow上几乎没有类似的问题,但对我来说不是很有用。相关文件是… 选项卡tsx import*as React from'

所以。。。我正在跟踪
并且得到了错误

类型“{children:Element;iconClassName:string;linkClassName:string;}”不可分配给类型“IntrinsicattAttributes&Props”。属性“children”不存在于类型“intrinsitattributes&Props”上。ts(2322)

在stackoverflow上几乎没有类似的问题,但对我来说不是很有用。相关文件是…
选项卡tsx

import*as React from'React';
导出接口道具{
onClick?:函数;
tabIndex?:编号;
isActive?:布尔值;
iconClassName:字符串;
linkClassName:字符串;
}
功能选项卡({
onClick=function(){return;},
tabIndex=0,
isActive=false,
iconClassName=“”,
linkClassName=“”
}:道具){
返回(
  • { event.preventDefault(); onClick(tabIndex); }} > {linkClassName}
  • ); }
    导出默认选项卡所以我找到了解决方案…
    在Tab.tsx的界面道具下添加子属性
    Tab.tsx现在有一个附加属性子级:React.ReactNode

    导出接口道具{
    onClick?:函数;
    tabIndex?:编号;
    isActive?:布尔值;
    iconClassName:字符串;
    linkClassName:字符串;
    子节点:React.ReactNode;
    }
    功能选项卡({
    onClick=function(){return;},
    tabIndex=0,
    isActive=false,
    iconClassName=“”,
    linkClassName=“”
    }:道具){
    返回(
    
  • { event.preventDefault(); onClick(tabIndex); }} > {linkClassName}
  • ); }
    导出默认选项卡所以我找到了解决方案…
    在Tab.tsx的界面道具下添加子属性
    Tab.tsx现在有一个附加属性子级:React.ReactNode

    导出接口道具{
    onClick?:函数;
    tabIndex?:编号;
    isActive?:布尔值;
    iconClassName:字符串;
    linkClassName:字符串;
    子节点:React.ReactNode;
    }
    功能选项卡({
    onClick=function(){return;},
    tabIndex=0,
    isActive=false,
    iconClassName=“”,
    linkClassName=“”
    }:道具){
    返回(
    
  • { event.preventDefault(); onClick(tabIndex); }} > {linkClassName}
  • ); } 导出默认选项卡