Skip to content

[Due for payment 2026-07-29] [Perf] De-duplicate Onyx subscriptions in report preview action buttons via shared hooks #96002

Description

@cristipaval

Problem

SubmitActionButton, ApproveActionButton, and PayActionButton each repeat the
same work on their own. Every one of them runs the same Onyx subscription block,
does the same transaction derivation, and defines its own confirmApproval handler.

This is duplicated logic across three components. It also means the same Onyx data
is subscribed to three times, which adds re-render work that we don't need.

Goal

  • Move the shared logic into three hooks:
    • useReportPreviewActionButtonData
    • useReportPreviewFilteredTransactions
    • useConfirmApproveReportAction
  • Update the three sub-buttons to use these hooks instead of repeating the code.
  • No behavior change. The buttons should look and work exactly as before.

Related

Issue OwnerCurrent Issue Owner: @linhvovan29546

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions