[NO QA] Remove redundant manual memoization from ModalProvider#85035
[NO QA] Remove redundant manual memoization from ModalProvider#85035srikarparsi merged 6 commits intomainfrom
Conversation
ModalProvider is compiled with React Compiler, which automatically handles memoization. The manual useCallback/useMemo wrappers added in #84799 are redundant and unnecessary. Co-authored-by: Yauheni Horbach <ZhenjaHorbach@users.noreply.github.com>
|
The failing checks are unrelated to this PR. Failing tests:
Analysis: This PR only modifies Evidence: The exact same two tests are also failing on multiple other unrelated PRs right now (e.g., |
|
@MelvinBot |
…tModalContextMemoization Co-authored-by: Yauheni Horbach <ZhenjaHorbach@users.noreply.github.com>
|
Branch has been updated by merging the latest |
|
@MelvinBot |
|
PR has been marked as ready for review. |
|
@srikarparsi Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
Reviewer Checklist
Screenshots/VideosAndroid: HybridApp2026-03-11.13.53.19.movAndroid: mWeb Chrome2026-03-11.13.51.58.moviOS: HybridApp2026-03-11.13.53.19.moviOS: mWeb Safari2026-03-11.13.51.58.movMacOS: Chrome / Safari2026-03-11.13.48.56.mov |
|
@MelvinBot |
The id parameter was never passed by any caller except ImportSpreadsheetConfirmModal, where it had no practical effect. This simplifies the showModal logic by always auto-generating IDs. Co-authored-by: Yauheni Horbach <ZhenjaHorbach@users.noreply.github.com>
|
Removed the unused
TypeScript type check passes. |
|
@srikarparsi Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
|
@MelvinBot |
|
I've rechecked PR #84799 and verified the current state of this PR against it. PR #84799 changed 5 files. Here's the revert status on this branch:
All changes from #84799 are correctly reverted except |
|
@MelvinBot
|
This reverts commit 0b73818.
|
You're right — the commit "Remove unused id parameter from showModal and showConfirmModal" was not part of the original scope. I've reverted it. The PR now only contains the original change: removing redundant |
|
@MelvinBot |
|
The failing check is unrelated to this PR. Failing test: Error: Analysis: This PR only modifies Evidence: The same test (job 7) passes on the latest Re-running the failed job should resolve this. |
|
Okay 2026-03-13.11.10.54.mov |
|
Jest issue is not related to this PR |
|
@MelvinBot |
|
Added |
|
🎯 @ZhenjaHorbach, thanks for reviewing and testing this PR! 🎉 An E/App issue has been created to issue payment here: #85215. |
|
PR doesn’t need product input as a code clean-up PR. Unassigning and unsubscribing myself. |
|
Looks like a job is failing @ZhenjaHorbach, could you merge main into the branch and push again? |
|
Jest issue is not related to our changes |
|
@MelvinBot |
…tModalContextMemoization Co-authored-by: Yauheni Horbach <ZhenjaHorbach@users.noreply.github.com>
|
Branch has been updated — merged the latest |
|
@srikarparsi |
|
@MelvinBot |
|
Updated the PR title to: [NO QA] Remove redundant manual memoization from ModalProvider |
Codecov Report❌ Looks like you've decreased code coverage for some files. Please write tests to increase, or at least maintain, the existing level of code coverage. See our documentation here for how to interpret this table.
|
|
🚧 @srikarparsi has triggered a test Expensify/App build. You can view the workflow run here. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
✋ This PR was not deployed to staging yet because QA is ongoing. It will be automatically deployed to staging after the next production release. |
|
🚀 Deployed to staging by https://github.com/srikarparsi in version: 9.3.39-0 🚀
|
|
🚀 Deployed to production by https://github.com/cristipaval in version: 9.3.39-3 🚀
|

Explanation of Change
Follow-up to #84799.
ModalProvideris compiled with React Compiler (babel-plugin-react-compiler), which automatically memoizes values and functions. The manualuseCallbackanduseMemowrappers added in that PR forshowModal,closeModal, and the context value are redundant and unnecessary.This PR removes the manual memoization, reverting
ModalContext.tsxto plain function declarations and an inline context value object — matching the style before #84799 and letting React Compiler handle optimization.Fixed Issues
$ #85479
Tests
Offline tests
N/A — this change removes redundant memoization wrappers and does not affect offline behavior.
QA Steps
Same as tests above.
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectiontoggleReportand notonIconClick)src/languages/*files and using the translation methodSTYLE.md) were followedAvatar, I verified the components usingAvatarare working as expected)StyleUtils.getBackgroundAndBorderStyle(theme.componentBG))npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.ScrollViewcomponent to make it scrollable when more elements are added to the page.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
N/A — no UI changes, only removing redundant memoization wrappers.
Android: mWeb Chrome
N/A
iOS: Native
N/A
iOS: mWeb Safari
N/A
MacOS: Chrome / Safari
N/A