Skip to content

[Due for payment 2025-07-25] [$250] Remove remaining withOnyx HOCs from the project | Batch 7 #65968

Closed

Description

@fabioh8010

Parent issue: #64225

Let's refactor the following files to use useOnyx instead of withOnyx. 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-source channel.

Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~021944840359649772614
  • Upwork Job ID: 1944840359649772614
  • Last Price Increase: 2025-07-14
  • Automatic offers:
    • linhvovan29546 | Contributor | 108043543

Activity

  1. linhvovan29546 commented on Jul 11, 2025

    @linhvovan29546
    Contributor

    Proposal

    Please re-state the problem that we are trying to solve in this issue.

    Let's refactor the following files to use useOnyx instead of withOnyx

    What is the root cause of that problem?

    Improvement

    What changes do you think we should make in order to solve the problem?

    Remove withOnyx from these components as described in the OP and replace it with the useOnyx hook.
    For example remove this HOC

    export default withOnyx<EnablePaymentsPageProps, EnablePaymentsPageOnyxProps>({

    The update

        const [userWallet] = useOnyx(ONYXKEYS.USER_WALLET, {initWithStoredValues: false, canBeMissing: true});
        

    Apply similar updates to the remaining components.

    function OnfidoPrivacy({walletOnfidoData = DEFAULT_WALLET_ONFIDO_DATA}: OnfidoPrivacyProps) {

            const [walletOnfidoData=DEFAULT_WALLET_ONFIDO_DATA] = useOnyx(ONYXKEYS.WALLET_ONFIDO, {initWithStoredValues: false});

            const [walletOnfidoData=DEFAULT_WALLET_ONFIDO_DATA] = useOnyx(ONYXKEYS.WALLET_ONFIDO, {initWithStoredValues: false});

        const [personalBankAccountDraft] = useOnyx(ONYXKEYS.FORMS.PERSONAL_BANK_ACCOUNT_FORM_DRAFT,{canBeMissing: true});
        const [personalBankAccount] = useOnyx(ONYXKEYS.PERSONAL_BANK_ACCOUNT,{canBeMissing: true});
       // We are not using userWallet, so it can be removed.
        const [userWallet] = useOnyx(ONYXKEYS.USER_WALLET,{canBeMissing: true});

    What specific scenarios should we cover in automated tests to prevent reintroducing this issue in the future?

    This is just an improvement, so no tests are necessary.

    What alternative solutions did you explore? (Optional)

    N/A

  2. self-assigned this
    on Jul 14, 2025
  3. added
    ExternalAdded to denote the issue can be worked on by a contributor
    on Jul 14, 2025
  4. changed the title [-]Remove remaining withOnyx HOCs from the project | Batch 7[/-] [+][$250] Remove remaining withOnyx HOCs from the project | Batch 7[/+] on Jul 14, 2025
  5. melvin-bot commented on Jul 14, 2025

    @melvin-bot
  6. added
    Help WantedApply this label when an issue is open to proposals by contributors
    on Jul 14, 2025
  7. melvin-bot commented on Jul 14, 2025

    @melvin-bot

    Triggered auto assignment to Contributor-plus team member for initial proposal review - @allroundexperts (External)

  8. removed
    Help WantedApply this label when an issue is open to proposals by contributors
    on Jul 14, 2025
  9. melvin-bot commented on Jul 14, 2025

    @melvin-bot

    📣 @linhvovan29546 🎉 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 📖

  10. 12 remaining items

  11. melvin-bot commented on Jul 25, 2025

    @melvin-bot

    Issue is ready for payment but no BZ is assigned. @kadiealexander you are the lucky winner! Please verify the payment summary looks correct and complete the checklist. Thanks!

  12. melvin-bot commented on Jul 28, 2025

    @melvin-bot

    @allroundexperts Whoops! This issue is 2 days overdue. Let's get this updated quick!

  13. linhvovan29546 commented on Jul 31, 2025

    @linhvovan29546
    Contributor

    @kadiealexander Could you please handle the payment when you have a chance? Thank you!

  14. kadiealexander commented on Jul 31, 2025

    @kadiealexander
    Contributor

    Payments needed:

    @allroundexperts please complete the checklist!

  15. kadiealexander commented on Aug 5, 2025

    @kadiealexander
    Contributor

    @allroundexperts bump on this

  16. kadiealexander commented on Aug 8, 2025

    @kadiealexander
    Contributor
  17. allroundexperts commented on Aug 8, 2025

    @allroundexperts
    Contributor

    @kadiealexander No checklist is needed here. This was a code improvement.

  18. trjExpensify commented on Jan 5, 2026

    @trjExpensify
    Contributor

    approved $250 for @allroundexperts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Awaiting PaymentAuto-added when associated PR is deployed to productionDailyKSv2ExternalAdded to denote the issue can be worked on by a contributor

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions