-1

I am trying to use react-bootstrap table 2 and I would like to do column span.

Here my example,

<BootstrapTable data={this.state.timesheets} >
    <TableHeaderColumn row="0" dataField='empid'>Field B</TableHeaderColumn>
    <TableHeaderColumn row="0" dataField='tdate'>Field C</TableHeaderColumn>
    <TableHeaderColumn row="0" colSpan="2">In</TableHeaderColumn>
    <TableHeaderColumn row="1">Time</TableHeaderColumn>
    <TableHeaderColumn row="1">Date</TableHeaderColumn>
</BootstrapTable>

I got this error:

Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: undefined. You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.

At the first step, this.state.timesheets would be nothing, so I thought because of this and I added one attribute noDataIndication="Table is Empty". but this error is still happening.

Please help.

Uwe Keim
  • 39,551
  • 56
  • 175
  • 291
lwin
  • 3,784
  • 6
  • 25
  • 46
  • The question is how you are exporting and importing the component which is essentially the source of error I suppose. Will be needing more code in terms of that to more understand your issue. – tarzen chugh Aug 21 '19 at 06:19

1 Answers1

0

According to the documentation, TableHeaderColumn will no longer support in react-bootstrap table 2.

Documentation

lwin
  • 3,784
  • 6
  • 25
  • 46