From 6928ca077d93a8a2008240cf7c5a87bf0022524e Mon Sep 17 00:00:00 2001 From: bartlomiej obudzinski Date: Fri, 6 Mar 2026 14:35:32 +0100 Subject: [PATCH 1/2] perf: Add Onyx selectors to MoneyRequestConfirmationList --- src/components/MoneyRequestConfirmationList.tsx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/components/MoneyRequestConfirmationList.tsx b/src/components/MoneyRequestConfirmationList.tsx index e63877660277b..bcfaaca365b62 100644 --- a/src/components/MoneyRequestConfirmationList.tsx +++ b/src/components/MoneyRequestConfirmationList.tsx @@ -226,6 +226,8 @@ type MoneyRequestConfirmationListProps = { type MoneyRequestConfirmationListItem = (Participant & {keyForList: string}) | OptionData; const mileageRateSelector = (policy: OnyxEntry) => DistanceRequestUtils.getDefaultMileageRate(policy); +const transactionReportSelector = (report: OnyxEntry) => report && {type: report.type}; +const policyDraftSelector = (draft: OnyxEntry) => draft && {customUnits: draft.customUnits}; function MoneyRequestConfirmationList({ transaction, @@ -276,8 +278,12 @@ function MoneyRequestConfirmationList({ }: MoneyRequestConfirmationListProps) { const [policyCategoriesReal] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY_CATEGORIES}${policyID}`); const [policyTags] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY_TAGS}${policyID}`); - const [transactionReport] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT}${transaction?.reportID}`); - const [policyDraft] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY_DRAFTS}${policyID}`); + const [transactionReport] = useOnyx(`${ONYXKEYS.COLLECTION.REPORT}${transaction?.reportID}`, { + selector: transactionReportSelector, + }); + const [policyDraft] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY_DRAFTS}${policyID}`, { + selector: policyDraftSelector, + }); const [defaultMileageRateDraft] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY_DRAFTS}${policyID}`, { selector: mileageRateSelector, }); From b90e0892a23ad3fd46241269a24b8f9bf1bae9c0 Mon Sep 17 00:00:00 2001 From: bartlomiej obudzinski Date: Fri, 6 Mar 2026 14:53:31 +0100 Subject: [PATCH 2/2] perf: fix selector return types in MoneyRequestConfirmationList --- src/components/MoneyRequestConfirmationList.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/MoneyRequestConfirmationList.tsx b/src/components/MoneyRequestConfirmationList.tsx index bcfaaca365b62..d599fc78ef005 100644 --- a/src/components/MoneyRequestConfirmationList.tsx +++ b/src/components/MoneyRequestConfirmationList.tsx @@ -226,8 +226,8 @@ type MoneyRequestConfirmationListProps = { type MoneyRequestConfirmationListItem = (Participant & {keyForList: string}) | OptionData; const mileageRateSelector = (policy: OnyxEntry) => DistanceRequestUtils.getDefaultMileageRate(policy); -const transactionReportSelector = (report: OnyxEntry) => report && {type: report.type}; -const policyDraftSelector = (draft: OnyxEntry) => draft && {customUnits: draft.customUnits}; +const transactionReportSelector = (report: OnyxEntry) => report && ({type: report.type} as OnyxEntry); +const policyDraftSelector = (draft: OnyxEntry) => draft && ({customUnits: draft.customUnits} as OnyxEntry); function MoneyRequestConfirmationList({ transaction,