-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Description
Explanation of Change
LHNOptionsList subscribed to the entire COLLECTION.REPORT_NAME_VALUE_PAIRS via useOnyx, then passed scoped entries as props to each OptionRowLHNData. However, OptionRowLHNData already has its own per-item useOnyx subscription for the same data (reportNameValuePairsEntry). The collection subscription was redundant.
The collection sub appeared in both renderItem deps (16 deps) and extraData (9 deps). Any NVP change for any report (e.g., archiving) invalidated the entire FlashList, causing all visible rows to re-render.
This PR removes the collection subscription and the prop fallback, relying solely on the per-item subscription that was already in place.
Profiling Results (React DevTools Profiler, archiving a report):
Total duration: -14%
LHNOptionsList: -19%
OptionRowLHNData: -19%
OptionRowLHN: -13%
Reassure benchmark: zero regression on existing SidebarLinks tests.
PR: #86644