Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/xpath/2.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 tabreact引导中的内容&;组件类道具_Reactjs_Ecmascript 6_React Bootstrap - Fatal编程技术网

Reactjs tabreact引导中的内容&;组件类道具

Reactjs tabreact引导中的内容&;组件类道具,reactjs,ecmascript-6,react-bootstrap,Reactjs,Ecmascript 6,React Bootstrap,我试图将react组件传递到TabContentscomponentClassprop中。此react组件还需要添加道具。我只是想知道这怎么可能 我试过一些类似的方法 import MyClass from './somewhere'; import { TabContent } from 'react-bootstrap'; const x = <MyClass thing={y} /> .. .. <TabContent componentClass={x} />

我试图将react组件传递到TabContents
componentClass
prop中。此react组件还需要添加道具。我只是想知道这怎么可能

我试过一些类似的方法

import MyClass from './somewhere';
import { TabContent } from 'react-bootstrap';
const x = <MyClass thing={y} />
..
..
<TabContent componentClass={x} /> 
从“/somewhere”导入MyClass;
从“react bootstrap”导入{TabContent};
常数x=
..
..
但它不起作用,因为TabContent类的componentClass propType似乎需要元素或字符串。我想知道我能把需要道具的react组件传递到选项卡窗格的最佳方式是什么


只是为了额外的信息。我要传入的这个组件从挂载时的API或类似的东西获取数据。

MyClass
将继承
TabContainer
中的所有道具。因此,您可以按原样传入组件,并在
选项卡container
上设置您想要的道具

从“/somewhere”导入MyClass;
从“react bootstrap”导入{TabContent};
..
..
//我的班级将有“这个。道具。东西”。

所以您不想在
TabContent
中呈现
MyClass
?您想要实现什么?我试图在
选项卡
中呈现
MyClass
,这意味着我需要使用
TabContent
,react引导文档意味着我需要将
MyClass
传递到TabContent的
componentClass
属性中