Skip to content

Commit c7fe8dc

Browse files
committed
refactor: add comment
1 parent a88fdd7 commit c7fe8dc

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

src/hooks/useArchivedReportsIdSet.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ function useArchivedReportsIdSet(): ArchivedReportsIDSet {
2525
},
2626
});
2727

28+
// useDeepCompareRef is used here to prevent unnecessary re-renders by maintaining referential equality
29+
// when the Set contents are the same, even if it's a new Set instance. This is important for performance
30+
// optimization since Sets are reference types and would normally cause re-renders even with same values
2831
return useDeepCompareRef(archivedReportsIdSet) ?? new Set<string>();
2932
}
3033

0 commit comments

Comments
 (0)