2

I need to show "There is no data to display" in the table body.

I am now using react-bootstrap-table-next which is an advanced version of react-bootstrap-table

import BootstrapTable from 'react-bootstrap-table-next'
...
<BootstrapTable
    keyField="id"
    data={data}
    columns={columns}
    expandRow={expandRow}
    options={{ noDataText: 'There is no data to display' }}
/>

It does not show wanted text when there is no data.

Any help would be appreciated.

Thanks in advance.

NinjaDev
  • 402
  • 2
  • 6

1 Answers1

5

Try this

const emptyDataMessage = () => { return 'No Data to Display';}

<BootstrapTable noDataIndication={emptyDataMessage} ../>

Shibu
  • 486
  • 1
  • 11
  • 20