Reactjs ReactBootstrap无法使用React子项正确呈现选项卡
当我尝试装箱一个ReactBootstrap Tabs nav()时,实际的可单击选项卡不会呈现。我认为这是因为如何使用this.props.children工作流。我正在使用JSON对象构建我的DOM:Reactjs ReactBootstrap无法使用React子项正确呈现选项卡,reactjs,react-bootstrap,children,react-props,Reactjs,React Bootstrap,Children,React Props,当我尝试装箱一个ReactBootstrap Tabs nav()时,实际的可单击选项卡不会呈现。我认为这是因为如何使用this.props.children工作流。我正在使用JSON对象构建我的DOM: { "type": "FRAMEWORK_REGION_DASHBOARDS", "component": "FrameworkRegionDashboards", "className": "framework-reg
{
"type": "FRAMEWORK_REGION_DASHBOARDS",
"component": "FrameworkRegionDashboards",
"className": "framework-region region-dashboards react-tab-panel",
"order": 2,
"style": {
"ux": {
"minHeight": "400px"
},
"dnd": {
"minHeight": "502px",
"padding": "10px",
"backgroundColor": "rgb(220, 220, 220)"
}
},
"children": [
{
"type": "DASHBOARD_TAB_OVERVIEW",
"component": "FrameworkDashboardTab",
"className": "tab-pane",
"order": 0,
"title": "Overview",
"visible": true,
"children": [
{
"name": "Device Info",
"type": "PANEL_DASHBOARD_DEVICE_INFO",
"component": "PanelDashboardDeviceInfo",
"order": 0,
"size": {
"h": 1,
"v": 1
}
}
]
}
我创建的仪表板选项卡如下所示:
return React.createElement(
ReactBootstrap.Tabs,
{
defaultActiveKey: 0,
"id": this.props.component.type,
"name": this.props.component.component,
"className": this.props.component.className,
"style": this.props.component.style[this.props.dnd],
"component": this.props.component
},
this.props.children
)
然后像这样渲染各个选项卡
return React.createElement(
ReactBootstrap.Tab,
{
"id": this.props.component.type,
"name": this.props.component.title,
"title": this.props.component.title,
"eventKey": this.props.component.order
},
this.props.children
);
然而,当标签DOM元素的结构被添加到DOM中时,应该包含实际可点击标签和标题的标签是空的
所以不是这个
我明白了:
有什么想法吗?只是一个一般性建议:使用JSX,将更容易理解正在发生的事情。@i.brod不幸的是,我们无法使用JSX或React 16+只是一个一般性建议:使用JSX,将更容易理解正在发生的事情。@i.brod不幸的是,由于我们的构建过程(遗留软件)的局限性,我们无法使用JSX或React 16+