problem with conditional TabPanel

UI Components for React
Post Reply
jpeter06
Posts: 4
Joined: 02 Jul 2014, 14:16

05 Mar 2019, 16:13

Hello All,
maybe this is a bug, can you help me?
I'am trying to dynamically select the tabs to present in a tabView.
Whe you use the next code code :

Code: Select all

<TabView>
...
{ false  &&   <TabPanel header="aaa"   rightIcon="pi pi-fw pi-file pi-menuitem-icon"> AAA  </TabPanel>  }
</TabView>
you get the next error:

Code: Select all

TypeError: Cannot read property 'props' of null

TabView.renderTabHeader
D:/SCRIPTS/protoWeb/adminreports2/node_modules/primereact/components/tabview/TabView.js:130
  127 | var _this2 = this;
  128 | 
  129 | var selected = this.isSelected(index);
> 130 | var className = (0, _classnames.default)(tab.props.headerClassName, 'p-unselectable-text', {
  131 |   'p-tabview-selected p-highlight': selected,
  132 |   'p-disabled': tab.props.disabled
  133 | });
View compiled

(anonymous function)
D:/SCRIPTS/protoWeb/adminreports2/node_modules/primereact/components/tabview/TabView.js:163
  160 |     var _this3 = this;
  161 | 
  162 |     return _react.default.Children.map(this.props.children, function (tab, index) {
> 163 |       return _this3.renderTabHeader(tab, index);
  164 |     });
  165 |   }
  166 | }, {
  

Post Reply

Return to “PrimeReact”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 30 guests