Skip to content

Commit 11a45ca

Browse files
committed
update the list key
1 parent 5b8f849 commit 11a45ca

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

src/components/Table/TableBody.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,8 @@ type TableBodyProps = ViewProps & {
4747
function TableBody<T>({contentContainerStyle, ...props}: TableBodyProps) {
4848
const styles = useThemeStyles();
4949
const {translate} = useLocalize();
50-
const {processedData: filteredAndSortedData, activeFilters, activeSearchString, listProps, hasActiveFilters, hasSearchString, isEmptyResult} = useTableContext<T>();
50+
const {processedData: filteredAndSortedData, activeSearchString, listProps, hasActiveFilters, hasSearchString, isEmptyResult} = useTableContext<T>();
5151
const {ListEmptyComponent, contentContainerStyle: listContentContainerStyle, ...restListProps} = listProps ?? {};
52-
const listKey = JSON.stringify(activeFilters);
5352

5453
// Determine the message based on what caused the empty result
5554
const getEmptyMessage = () => {
@@ -84,7 +83,7 @@ function TableBody<T>({contentContainerStyle, ...props}: TableBodyProps) {
8483
{...props}
8584
>
8685
<FlashList<T>
87-
key={listKey}
86+
key={`${hasActiveFilters}`}
8887
data={filteredAndSortedData}
8988
ListEmptyComponent={isEmptyResult ? EmptyResultComponent : ListEmptyComponent}
9089
contentContainerStyle={[filteredAndSortedData.length === 0 && styles.flex1, listContentContainerStyle, contentContainerStyle]}

0 commit comments

Comments
 (0)