React-bootstrap & componentClass 道具中的 TabContent

TabContent in react-bootstrap & componentClass props

我正在尝试将反应组件传递到 TabContents componentClass 道具中。这个 React 组件还需要添加 props。我只是想知道这怎么可能。

我尝试了一些类似

的方法
import MyClass from './somewhere';
import { TabContent } from 'react-bootstrap';
const x = <MyClass thing={y} />
..
..
<TabContent componentClass={x} /> 

但它不起作用似乎 TabContent class' componentClass propType 需要元素或字符串。我想知道什么是我可以将需要不是纯组件的道具的反应组件传递给选项卡窗格的最佳方式...

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

MyClass 将继承 TabContainer 的所有属性。所以你可以按原样传递组件并在 TabContainer.

上设置你想要的道具
import MyClass from './somewhere';
import { TabContent } from 'react-bootstrap';
..
..
<TabContent componentClass={MyClass} thing={y} /> 
// MyClass will have `this.props.thing`.