Skip to content

perf: hoist transaction violations for MoneyRequestReportTransactionList items #91963

@mountiny

Description

@mountiny

Problem

On the expense report transaction list, each row called useTransactionViolations, which subscribes to Onyx per transaction multiple times. With many rows in a virtualized FlashList, that becomes N rows × several subscriptions — any Onyx update can trigger re-renders across many rows, and list recycling keeps those subscriptions active while scrolling. This matches the anti-pattern of calling useOnyx inside list item render paths (PERF-3).

Solution

Hoists transaction violation filtering from per-row useOnyx subscriptions to the parent MoneyRequestReportTransactionList, which already subscribes to the full TRANSACTION_VIOLATIONS collection for RBR sorting. A shared getVisibleTransactionViolations helper filters violations once at the list level and passes them as stable props to each row, using a stable EMPTY_VIOLATIONS reference for rows with no violations to keep FlashList row prop identity stable.

PR

#91958

Issue OwnerCurrent Issue Owner: @aimane-chnaif

Metadata

Metadata

Labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions