Skip to content

Commit 6fe0875

Browse files
authored
🤖 Merge PR DefinitelyTyped#50155 [react-table] Add autoResetHiddenColumns to TableOptions by @jamirvin
1 parent 7af046e commit 6fe0875

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

‎types/react-table/index.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,7 @@ export type UseTableOptions<D extends object> = {
174174
defaultColumn: Partial<Column<D>>;
175175
getSubRows: (originalRow: D, relativeIndex: number) => D[];
176176
getRowId: (originalRow: D, relativeIndex: number, parent?: Row<D>) => string;
177+
autoResetHiddenColumns: boolean;
177178
}>;
178179

179180
export type PropGetter<D extends object, Props, T extends object = never, P = Partial<Props>> =

‎types/react-table/react-table-tests.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -384,6 +384,9 @@ function Table({ columns, data, updateMyData, skipPageReset = false }: Table<Dat
384384
// We also need to pass this so the page doesn't change
385385
// when we edit the data, undefined means using the default
386386
autoResetPage: !skipPageReset,
387+
// Do not reset hidden columns when columns change. Allows
388+
// for creating columns during render.
389+
autoResetHiddenColumns: false,
387390
},
388391
useGroupBy,
389392
useFilters,

0 commit comments

Comments
 (0)