Skip to content

Migrate IOURequestEditReportCommon.tsx from useOptionsList to useFilteredOptions #82183

Closed

Description

@mountiny

Problem

IOURequestEditReportCommon.tsx currently uses the useOptionsList hook from OptionListContextProvider, which causes unnecessary background recalculations on every personal details or reports change.

This is part of a larger effort to remove OptionListContextProvider entirely. See parent issue #82193 for full context.

Solution

Replace useOptionsList with useFilteredOptions following the pattern established in PR #74071 (NewChatPage migration).

Current usage:

  • Properties used: options only
  • Called with: no arguments
  • File: src/pages/iou/request/step/IOURequestEditReportCommon.tsx

How options are used:

  • Only options.reports is used in a useMemo to find matching report options for alternateText, brickRoadIndicator, and policyID enrichment
  • No loading/initialization flags are checked

Migration steps:

  1. Replace import {useOptionsList} from '@components/OptionListContextProvider' with import useFilteredOptions from '@hooks/useFilteredOptions'
  2. Replace useOptionsList() call with useFilteredOptions({ enabled: true })
  3. Handle the null case for options (when loading) -- default to empty reports array in the useMemo
  4. The rest of the logic should work as-is since it only reads options.reports

Complexity: Simple

Reference PR: #74071

Tests

  • Verify editing a money request report works correctly
  • Verify the report selector shows correct alternate text and indicators
  • Verify no errors appear in the JS console
  • Test on all platforms (iOS, Android, Web, Desktop)

Activity

  1. abbasifaizan70 commented on Feb 11, 2026

    @abbasifaizan70
    Contributor

    I can work on this if it's open to external contributors.

  2. shubham1206agra commented on Feb 15, 2026

    @shubham1206agra
    Contributor

    @mountiny Please assign me and @hoangzinh here

  3. melvin-bot commented on Feb 19, 2026

    @melvin-bot

    @hoangzinh, @mountiny, @shubham1206agra Whoops! This issue is 2 days overdue. Let's get this updated quick!

  4. hoangzinh commented on Feb 19, 2026

    @hoangzinh
    Contributor

    PR is deployed to Prod. We can close this issue

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

Metadata

Metadata

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions