material-react-table 0.26.2 → 0.26.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.26.2",
2
+ "version": "0.26.3",
3
3
  "license": "MIT",
4
4
  "name": "material-react-table",
5
5
  "description": "A fully featured Material UI implementation of TanStack React Table, inspired by material-table and the MUI X DataGrid, written from the ground up in TypeScript.",
@@ -710,6 +710,7 @@ export type MaterialReactTableProps<TData extends Record<string, any> = {}> =
710
710
  onShowAlertBannerChange?: OnChangeFn<boolean>;
711
711
  onShowFiltersChange?: OnChangeFn<boolean>;
712
712
  onShowGlobalFilterChange?: OnChangeFn<boolean>;
713
+ onTableInstanceChange?: (table: MRT_TableInstance<TData>) => void;
713
714
  positionActionsColumn?: 'first' | 'last';
714
715
  positionGlobalFilter?: 'left' | 'right';
715
716
  positionPagination?: 'bottom' | 'top' | 'both';
@@ -252,7 +252,6 @@ export const MRT_TableRoot = <TData extends Record<string, any> = {}>(
252
252
  columns: columnDefs,
253
253
  data,
254
254
  getSubRows: (row) => row?.subRows,
255
- //@ts-ignore
256
255
  globalFilterFn:
257
256
  MRT_FilterFns[currentGlobalFilterFn] ?? MRT_FilterFns.fuzzy,
258
257
  initialState,
@@ -297,6 +296,8 @@ export const MRT_TableRoot = <TData extends Record<string, any> = {}>(
297
296
  setShowGlobalFilter: props.onShowGlobalFilterChange ?? setShowGlobalFilter,
298
297
  } as MRT_TableInstance;
299
298
 
299
+ useEffect(() => props?.onTableInstanceChange?.(table as any), [table]);
300
+
300
301
  return (
301
302
  <>
302
303
  <Dialog