Repository navigation
[Due for payment 2025-07-30] [$250] Remove remaining withOnyx HOCs from the project | Batch 4 #65964
Description
Activity
Proposal
Please re-state the problem that we are trying to solve in this issue.
Remove remaining withOnyx HOCs
What is the root cause of that problem?
We're using the deprecated HOCs here
const IOURequestStepCurrencyWithOnyx = withOnyx<IOURequestStepCurrencyProps, IOURequestStepCurrencyOnyxProps>({ const IOURequestStepTaxAmountPageWithOnyx = withOnyx<IOURequestStepTaxAmountPageProps, IOURequestStepTaxAmountPageOnyxProps>({ What changes do you think we should make in order to solve the problem?
Replace
withOnyxwithuseOnyxand update the prop type accordinglyconst [draftTransaction] = useOnyx(`${ONYXKEYS.COLLECTION.TRANSACTION_DRAFT}${transactionID}`, {canBeMissing: true}); const [recentlyUsedCurrencies] = useOnyx(ONYXKEYS.RECENTLY_USED_CURRENCIES, {canBeMissing: true});App/src/pages/iou/request/step/IOURequestStepCurrency.tsx
Lines 93 to 105 in 0523929
const IOURequestStepCurrencyWithOnyx = withOnyx<IOURequestStepCurrencyProps, IOURequestStepCurrencyOnyxProps>({ draftTransaction: { key: ({route}) => { const transactionID = route?.params?.transactionID ?? -1; return `${ONYXKEYS.COLLECTION.TRANSACTION_DRAFT}${transactionID}`; }, }, recentlyUsedCurrencies: { key: ONYXKEYS.RECENTLY_USED_CURRENCIES, }, })(IOURequestStepCurrency); /* eslint-disable rulesdir/no-negated-variables */ const [splitDraftTransaction] = useOnyx(`${ONYXKEYS.COLLECTION.SPLIT_TRANSACTION_DRAFT}${transactionID}`, {canBeMissing: true}); const [policy] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY}${report ? report.policyID : '-1'}`, {canBeMissing: true}); const [policyCategories] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY_CATEGORIES}${report ? report.policyID : '-1'}`, {canBeMissing: true}); const [policyTags] = useOnyx(`${ONYXKEYS.COLLECTION.POLICY_TAGS}${report ? report.policyID : '-1'}`, {canBeMissing: true});App/src/pages/iou/request/step/IOURequestStepTaxAmountPage.tsx
Lines 181 to 200 in 0523929
const IOURequestStepTaxAmountPageWithOnyx = withOnyx<IOURequestStepTaxAmountPageProps, IOURequestStepTaxAmountPageOnyxProps>({ splitDraftTransaction: { key: ({route}) => { const transactionID = route?.params.transactionID ?? 0; return `${ONYXKEYS.COLLECTION.SPLIT_TRANSACTION_DRAFT}${transactionID}`; }, }, policy: { key: ({report}) => `${ONYXKEYS.COLLECTION.POLICY}${report ? report.policyID : '-1'}`, }, policyCategories: { key: ({report}) => `${ONYXKEYS.COLLECTION.POLICY_CATEGORIES}${report ? report.policyID : '-1'}`, }, policyTags: { key: ({report}) => `${ONYXKEYS.COLLECTION.POLICY_TAGS}${report ? report.policyID : '-1'}`, }, })(IOURequestStepTaxAmountPage); // eslint-disable-next-line rulesdir/no-negated-variables const IOURequestStepTaxAmountPageWithWritableReportOrNotFound = withWritableReportOrNotFound(IOURequestStepTaxAmountPageWithOnyx); What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?
None
What alternative solutions did you explore? (Optional)
Reminder: Please use plain English, be brief and avoid jargon. Feel free to use images, charts or pseudo-code if necessary. Do not post large multi-line diffs or write walls of text. Do not create PRs unless you have been hired for this job.
- addedExternalAdded to denote the issue can be worked on by a contributorAdded to denote the issue can be worked on by a contributor
on Jul 14, 2025 - changed the title
[-]Remove remaining withOnyx HOCs from the project | Batch 4[/-][+][$250] Remove remaining withOnyx HOCs from the project | Batch 4[/+]on Jul 14, 2025 Job added to Upwork: https://www.upwork.com/jobs/~021944840312476435526
- addedHelp WantedApply this label when an issue is open to proposals by contributorsApply this label when an issue is open to proposals by contributors
on Jul 14, 2025 Triggered auto assignment to Contributor-plus team member for initial proposal review - @alitoshmatov (
External)- removedHelp WantedApply this label when an issue is open to proposals by contributorsApply this label when an issue is open to proposals by contributors
on Jul 14, 2025 📣 @nkdengineer 🎉 An offer has been automatically sent to your Upwork account for the Contributor role 🎉 Thanks for contributing to the Expensify app!
Offer link
Upwork job
Please accept the offer and leave a comment on the Github issue letting us know when we can expect a PR to be ready for review 🧑💻
Keep in mind: Code of Conduct | Contributing 📖- addedReviewingHas a PR in reviewHas a PR in reviewWeeklyKSv2KSv2and removedDailyKSv2KSv2
on Jul 16, 2025 7 remaining items
@alitoshmatov Uh oh! This issue is overdue by 2 days. Don't forget to update your issues!
@alitoshmatov Still overdue 6 days?! Let's take care of this!
- addedBugSomething is broken. Auto assigns a BugZero manager.Something is broken. Auto assigns a BugZero manager.
on Aug 5, 2025 Marking as a bug to get help on payment
Triggered auto assignment to @OfstadC (
Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details. Please add this bug to a GH project, as outlined in the SO.No C+ checklist needed here imo
Reacted by Corinne OfstadPayment Summary
Contributor: @nkdengineer paid $250 via Upwork
Contributor+: @alitoshmatov due $250 via NewDotRequested payment in ND
$250 approved for @alitoshmatov
Parent issue: #64225
Let's refactor the following files to use
useOnyxinstead ofwithOnyx. All the work must be done in one PR.After refactor please test them extensively and provide test steps in your PR. In case of questions please ask in
#expensify-open-sourcechannel.Upwork Automation - Do Not Edit
Issue Owner
Current Issue Owner: @alitoshmatov