Skip to content

Commit 0cf4481

Browse files
authored
Merge pull request Expensify#90452 from callstack-internal/perf/search-list-remove-dead-props
[No QA] perf(search): remove dead policies and queryJSONHash props from ListItem
2 parents f17b80d + 18e3e6c commit 0cf4481

2 files changed

Lines changed: 1 addition & 10 deletions

File tree

src/components/Search/SearchList/ListItem/types.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,6 @@ type SearchListActionProps = {
4848
};
4949

5050
type ChatListItemProps<TItem extends ListItem> = ListItemProps<TItem> & {
51-
queryJSONHash?: number;
52-
5351
/** The report data */
5452
report?: Report;
5553

@@ -434,7 +432,6 @@ type TransactionGroupListItemProps<TItem extends ListItem> = ListItemProps<TItem
434432
SearchListActionProps & {
435433
groupBy?: SearchGroupBy;
436434
searchType?: SearchDataTypes;
437-
policies?: OnyxCollection<Policy>;
438435
accountID?: number;
439436
columns?: SearchColumnType[];
440437
newTransactionID?: string;

src/components/Search/SearchList/index.tsx

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ function SearchList({
229229
const styles = useThemeStyles();
230230
const expensifyIcons = useMemoizedLazyExpensifyIcons(['CheckSquare']);
231231

232-
const {hash, groupBy, type} = queryJSON;
232+
const {groupBy, type} = queryJSON;
233233
const flattenedItems = useMemo(() => {
234234
if (groupBy || type === CONST.SEARCH.DATA_TYPES.EXPENSE_REPORT) {
235235
if (!isTransactionGroupListItemArray(data)) {
@@ -299,8 +299,6 @@ function SearchList({
299299
const [isModalVisible, setIsModalVisible] = useState(false);
300300
const [longPressedItem, setLongPressedItem] = useState<SearchListItem>();
301301

302-
const [policies] = useOnyx(ONYXKEYS.COLLECTION.POLICY);
303-
304302
const hasItemsBeingRemoved = prevDataLength && prevDataLength > data.length;
305303
const personalDetails = usePersonalDetails();
306304

@@ -445,9 +443,7 @@ function SearchList({
445443
onSelectionButtonPress={onCheckboxPress}
446444
canSelectMultiple={canSelectMultiple}
447445
item={itemWithSelection}
448-
queryJSONHash={hash}
449446
columns={columns}
450-
policies={policies}
451447
policyForMovingExpenses={policyForMovingExpenses}
452448
isDisabled={isDisabled}
453449
groupBy={groupBy}
@@ -485,9 +481,7 @@ function SearchList({
485481
handleLongPressRow,
486482
onCheckboxPress,
487483
canSelectMultiple,
488-
hash,
489484
columns,
490-
policies,
491485
personalDetails,
492486
userBillingFundID,
493487
isOffline,

0 commit comments

Comments
 (0)