feat: add drag and drop column rearrangement for table viz (#19381)

This commit is contained in:
stevetracvc
2022-05-24 20:10:57 -06:00
committed by GitHub
parent ce547f4098
commit 7e9b85f76c
8 changed files with 93 additions and 6 deletions

View File

@@ -350,6 +350,7 @@ function useInstance<D extends object>(instance: TableInstance<D>) {
data,
page,
rows,
allColumns,
getTableSize = () => undefined,
} = instance;
@@ -370,7 +371,7 @@ function useInstance<D extends object>(instance: TableInstance<D>) {
useMountedMemo(getTableSize, [getTableSize]) || sticky;
// only change of data should trigger re-render
// eslint-disable-next-line react-hooks/exhaustive-deps
const table = useMemo(renderer, [page, rows]);
const table = useMemo(renderer, [page, rows, allColumns]);
useLayoutEffect(() => {
if (!width || !height) {