Replies: 2 comments
-
I'm struggling with the same problem. |
Beta Was this translation helpful? Give feedback.
0 replies
-
Hi @dls01, the useExportData hook is not original for now, so @Lonolf you're right, you have to install as a different npm package |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello
Im trying to use the useExportData hook (which for some reason is not in the doc). but when I try to add it to UseTable(), I get:
Cannot find name 'useExportData'
`const {
headerGroups,
rows,
page,
filters,
allColumns,
selectedFlatRows,
canPreviousPage,
canNextPage,
pageOptions,
pageCount,
setFilter,
prepareRow,
gotoPage,
nextPage,
previousPage,
setPageSize,
getTableProps,
getTableBodyProps,
setAllFilters,
exportData,
state: {pageIndex, pageSize},
} = useTable(
{
columns,
data,
Filter: CustomColumnFilter,
filterTypes,
autoResetPage,
useExpanded,
initialState: {
hiddenColumns: columns.filter((col: any) => col.show === false).map((col) => col.id || col.accessor),
pageIndex: 0,
pageSize: 20,
},
getExportFileBlob, --------------------- > added for export
useFilters,
If I add it inside the object like so:
= useTable(
{
columns,
data,
Filter: CustomColumnFilter,
filterTypes,
autoResetPage,
useExpanded,
initialState: {
hiddenColumns: columns.filter((col: any) => col.show === false).map((col) => col.id || col.accessor),
pageIndex: 0,
pageSize: 20,
},
getExportFileBlob, --------------------- > added for export
useFilters,
useExportData
i am getting:
"No value exists in scope for the shorthand property 'useExportData'. Either declare one or provide an initializer"
when I try to export it from react-table:
import { useExportData } from 'react-table';
I get "Module '"react-table"' has no exported member 'useExportData'"
Any advice?
Edit:
I found the git for useExportData here:
https://github.com/tannerlinsley/react-table/pull/1941/files/a7ccf98806dc7eea327cdc0ed3fde92c1bcc8be7
Beta Was this translation helpful? Give feedback.
All reactions