react-data-table-component
react-data-table-component copied to clipboard
Data-Table print and export issues
There is a problem in this library where if i used columns like this , the print and export button won't work and i get this error :
Uncaught Error: selector must be a . delimted string eg (my.property)
const columns = [
{
name: "No.",
cell: (a, i) => i + 1,
},
{
name: "username",
selector: row => row.username,
sortable: true
}]
but when i use it like this it works but i get alot of errors in the console :
react_devtools_backend.js:4026 Warning: username is a string based column selector which has been deprecated as of v7 and will be removed in v8. Instead, use a selector function e.g. row => row[field]...
const columns = [
{
name: "No.",
cell: (a, i) => i + 1,
},
{
name: "username",
selector: 'username',
sortable: true
}]
also another issue that the column No. display as NaN when i try to print or export , anyone fixed this issue before ?
i have same issue