Browse Source

Stop CfdTable from refreshing

CfdTable uses react-table which resets its state if the data sources changes. We don't want some state to reset, e.g. sorting and un-expanding because that will mess with the user if the table suddenly changes.

Note: it looks like that the provided types are missing this field. It's been tested and it works as expected but we need to @ts-ignore because tsc would complain.
upload-correct-windows-binary
Philipp Hoenisch 3 years ago
parent
commit
50cb75d093
No known key found for this signature in database GPG Key ID: E5F8E74C672BC666
  1. 3
      frontend/src/components/cfdtables/CfdTable.tsx

3
frontend/src/components/cfdtables/CfdTable.tsx

@ -269,6 +269,9 @@ export function Table({ columns, tableData, hiddenColumns, renderDetails }: Tabl
initialState: { initialState: {
hiddenColumns, hiddenColumns,
}, },
// @ts-ignore: this field exists and it works as expected.
autoResetExpanded: false,
autoResetSortBy: false,
}, },
useSortBy, useSortBy,
useExpanded, useExpanded,

Loading…
Cancel
Save