DataTable: Upgrade issue

UI Components for React
Post Reply
peter_servpower
Posts: 1
Joined: 11 Feb 2020, 12:08

15 May 2020, 14:44

I have just upgraded prime react from version 3.4.0 to version 4.2.0 and primeicons from 2.0.0 to 3.0.0-rc.1 - now my DataTable no longer works.

In the console the error message is:
Subscriber.js?9a65:246 Uncaught Invariant Violation: 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. Check the render method of `TableHeader`.

In my code:
. . .
import {DataTable} from 'primereact/datatable';
import {Column} from 'primereact/column';
import {MultiSelect} from 'primereact/multiselect';
import {InputText} from 'primereact/inputtext';
import 'primereact/resources/primereact.min.css';
import 'primeicons/primeicons.css';
. . .

<DataTable
stateStorage="local"
stateKey={this.listStateKey}
onValueChange={sortedData => this.checkSortedDataHandler(sortedData)}
id={this.listStateKey}
header={header}
value={this.state.listTableData}
responsive={true}
sortMode="multiple"
ref={(el) => this.dt = el}
reorderableColumns={true}
selection={this.state.selectedJobs}
onSelectionChange={this.jobSelectionChangeHandler}
resizableColumns={true}
columnResizeMode="expand"
filterMatchMode="contains"
scrollable={true}
scrollHeight="99%"
first={0}
onRowSelect={this.jobSelectedHandler}
onColReorder={this.colReorderHandler}
rowClassName={this.rowClassName}
style={{width: styleWidth}}
globalFilter={globalFilter}>
{columns}
</DataTable>

Any help would be appreciated.

Peter

Post Reply

Return to “PrimeReact”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 1 guest