Skip to content

Remove redundant reportNameValuePairs collection subscription from LHN #86649

@JS00001

Description

@JS00001

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

Issue OwnerCurrent Issue Owner: @BartekObudzinski

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions