My goal is to have the table head whether or not there is data, but I also don’t want a noDataComponent, because the idea I want to execute requires there to be none. I can’t seem to find any information online about preventing the head from going away when there is no data, only other components that do that natively.
<DataTable
columns={columns}
data={data}
actions={actions}
progressPending={loading}
noDataComponent={<></>}
/>
>Solution :
Simply set persistTableHead to true.
<DataTable
columns={columns}
data={data}
actions={actions}
progressPending={loading}
persistTableHead={true}
/>
Description from the doc:
persistTableHead: Show the table head (columns) even when progressPending is true. Note: The noTableHead will always hide the table head (columns) even when using persistTableHead