Skip to content

Commit

Permalink
fix: typescript error
Browse files Browse the repository at this point in the history
  • Loading branch information
mariaozamiz committed Mar 21, 2024
1 parent 09d7c04 commit d136eca
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/webapp/components/data-table/DataTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -145,12 +145,11 @@ export function DataTable<T extends ReferenceObject = TableObject>(props: DataTa
const [stateSelection, updateSelection] = useState(initialState.selection || []);
const [statePagination, updatePagination] = useState(initialState.pagination);
const [visibleColumns, updateVisibleColumns] = useState<Array<keyof T>>([]);
const [stateSorting, updateSorting] = useState(
initialState.sorting || {
field: columns?.[0]?.name || "",
order: "asc" as const,
}
);
const initialStateSorting: TableSorting<T> = {
field: columns?.[0]?.name || "id",
order: "asc" as const,
};
const [stateSorting, updateSorting] = useState<TableSorting<T>>(initialStateSorting);

useEffect(() => updatePagination(pagination => ({ ...pagination, page: 1 })), [resetKey]);

Expand Down

0 comments on commit d136eca

Please sign in to comment.