Skip to content

[Perf] Refactor ReportPreviewActionButton to consume MoneyRequestReportPreviewProvider #95366

Description

@cristipaval

Problem

ReportPreviewActionButton still gets all its data through props. The action-button and total row alone relay around 16 props down from the preview. This prop drilling causes wide re-renders: when the parent recomputes, the button and its Pay / Submit / Approve sub-buttons re-render even if nothing they show changed.

Now that #94681 adds MoneyRequestReportPreviewProvider with per-concern context slices, the action button can read only the data it needs from the provider instead of receiving it as props.

Goal

  • Decompose ReportPreviewActionButton into smaller, focused pieces.
  • Refactor it (and its Pay / Submit / Approve sub-buttons) to consume data from MoneyRequestReportPreviewProvider context slices instead of props.
  • Remove the prop drilling for the action-button path.

This is a restructure. The buttons should look and behave exactly as before.

Related

Issue OwnerCurrent Issue Owner: @OlimpiaZurek

Metadata

Metadata

Labels

Type

No type

Fields

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