Skip to content

Remove OptionListContextProvider from AuthScreens.tsx and delete the provider #82192

@mountiny

Description

@mountiny

Problem

After all consumers of useOptionsList have been migrated to useFilteredOptions, the OptionListContextProvider becomes dead code that should be removed.

This is the final cleanup issue in the effort to remove OptionListContextProvider entirely. See parent issue #82193 for full context.

Solution

  1. Remove OptionsListContextProvider from the ComposeProviders array in src/libs/Navigation/AppNavigator/AuthScreens.tsx
  2. Delete the provider file: src/components/OptionListContextProvider.tsx
  3. Update/delete test files that reference the provider:
    • Delete tests/unit/OptionListContextProviderTest.tsx (tests the now-deleted provider)
    • Update tests/perf-test/SearchRouter.perf-test.tsx (remove OptionsListContext.Provider mock)
    • Update tests/ui/PureReportActionItemTest.tsx (remove provider wrapper)
    • Update tests/ui/MoneyRequestReportPreview.test.tsx (remove provider wrapper)
  4. Remove any remaining imports/references to OptionListContextProvider, OptionsListContextProvider, OptionsListContext, or useOptionsList across the codebase

Depends on: All other migration sub-issues in this effort must be completed first. Only proceed when there are zero remaining production consumers of useOptionsList.

Complexity: Medium (touches multiple files but straightforward removals)

Reference PR: #74071

Tests

  • Verify the app starts and runs correctly without the provider
  • Verify all screens that previously used useOptionsList still work (they should now use useFilteredOptions)
  • Verify all test suites pass
  • Verify no errors appear in the JS console
  • Test on all platforms (iOS, Android, Web, Desktop)
Issue OwnerCurrent Issue Owner: @shubham1206agra

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions