Andy Vincent
Andy Vincent

Reputation: 83

How to remove noDataText completely?

When I make it empty string, like

noDataText=' '

...it still show an empty rectangle (class=rt-noData). 'False' doesn't help of course.

What would work?

Upvotes: 1

Views: 1257

Answers (1)

Volodymyr
Volodymyr

Reputation: 1408

react-table allows you to override some internal components so you can replace default NoDataComponent with the one that renders null. The component can be overridden either globally or per instance.

Global override:

import { ReactTableDefaults } from 'react-table';

const NullComponent = () => null;
Object.assign(ReactTableDefaults, { NoDataComponent: NullComponent });

Instance override:

const NullComponent = () => null;

<ReactTable
  NoDataComponent={NullComponent}
  ... 
/>

Upvotes: 3

Related Questions