mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-08 08:53:51 +00:00
refactor: stabilise table options
This commit is contained in:
committed by
Carlos Valente
parent
84a5b4fe5b
commit
2867c8301d
@@ -1,4 +1,4 @@
|
||||
import { useRef } from 'react';
|
||||
import { useCallback, useRef } from 'react';
|
||||
import { ColumnDef, flexRender, getCoreRowModel, useReactTable } from '@tanstack/react-table';
|
||||
import Color from 'color';
|
||||
import {
|
||||
@@ -92,13 +92,13 @@ export default function CuesheetTable(props: CuesheetTableProps) {
|
||||
},
|
||||
});
|
||||
|
||||
const setAllVisible = () => {
|
||||
const setAllVisible = useCallback(() => {
|
||||
table.toggleAllColumnsVisible(true);
|
||||
};
|
||||
}, []);
|
||||
|
||||
const resetColumnResizing = () => {
|
||||
const resetColumnResizing = useCallback(() => {
|
||||
setColumnSizing({});
|
||||
};
|
||||
}, []);
|
||||
|
||||
const headerGroups = table.getHeaderGroups();
|
||||
const rowModel = table.getRowModel();
|
||||
|
||||
Reference in New Issue
Block a user