Expose table data (#691)

* Expose table data as a variable

* fix
This commit is contained in:
Navaneeth Pk 2021-09-05 21:22:27 +05:30 committed by GitHub
parent a360fdda74
commit b175004ad1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -533,6 +533,7 @@ export function Table({
previousPage,
setPageSize,
state,
rows,
prepareRow,
setAllFilters,
preGlobalFilteredRows,
@ -558,6 +559,16 @@ export function Table({
useExportData
);
useEffect(() => {
const pageData = page.map(row => row.original);
const currentData = rows.map(row => row.original);;
onComponentOptionsChanged(component, [
['currentPageData', pageData],
['currentData', currentData]
]);
}, [tableData.length, componentState.changeSet]);
useEffect(() => {
if (!state.columnResizing.isResizingColumn) {
changeCanDrag(true);