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 Owner
Current Issue Owner: @OlimpiaZurek
Problem
ReportPreviewActionButtonstill 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
MoneyRequestReportPreviewProviderwith per-concern context slices, the action button can read only the data it needs from the provider instead of receiving it as props.Goal
ReportPreviewActionButtoninto smaller, focused pieces.MoneyRequestReportPreviewProvidercontext slices instead of props.This is a restructure. The buttons should look and behave exactly as before.
Related
Issue Owner
Current Issue Owner: @OlimpiaZurek