Problem
useAllPolicyExpenseChatReportActions built a filtered map of policy-expense-chat report actions on every render and was consumed by 5 components, even though the filtered map was only needed inside event-handler callbacks. On heavy accounts this wasted significant work on every render cycle — e.g. KYCWall took ~275ms on a single "Pay" button press (4x CPU throttle).
Solution
Extracted the filtering logic into a pure function getAllPolicyExpenseChatReportActions(allReports, allReportActions) in ReportUtils.ts, migrated all 5 consumers to call it lazily inside the callbacks that need it, and deleted the unused hook. No behavior change — computation moves from the render path to callbacks only.
PR
#93781
Issue Owner
Current Issue Owner: @mallenexpensify
Problem
useAllPolicyExpenseChatReportActionsbuilt a filtered map of policy-expense-chat report actions on every render and was consumed by 5 components, even though the filtered map was only needed inside event-handler callbacks. On heavy accounts this wasted significant work on every render cycle — e.g.KYCWalltook ~275ms on a single "Pay" button press (4x CPU throttle).Solution
Extracted the filtering logic into a pure function
getAllPolicyExpenseChatReportActions(allReports, allReportActions)inReportUtils.ts, migrated all 5 consumers to call it lazily inside the callbacks that need it, and deleted the unused hook. No behavior change — computation moves from the render path to callbacks only.PR
#93781
Issue Owner
Current Issue Owner: @mallenexpensify