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
- Remove
OptionsListContextProvider from the ComposeProviders array in src/libs/Navigation/AppNavigator/AuthScreens.tsx
- Delete the provider file:
src/components/OptionListContextProvider.tsx
- 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)
- 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 Owner
Current Issue Owner: @shubham1206agra
Problem
After all consumers of
useOptionsListhave been migrated touseFilteredOptions, theOptionListContextProviderbecomes dead code that should be removed.This is the final cleanup issue in the effort to remove
OptionListContextProviderentirely. See parent issue #82193 for full context.Solution
OptionsListContextProviderfrom theComposeProvidersarray insrc/libs/Navigation/AppNavigator/AuthScreens.tsxsrc/components/OptionListContextProvider.tsxtests/unit/OptionListContextProviderTest.tsx(tests the now-deleted provider)tests/perf-test/SearchRouter.perf-test.tsx(removeOptionsListContext.Providermock)tests/ui/PureReportActionItemTest.tsx(remove provider wrapper)tests/ui/MoneyRequestReportPreview.test.tsx(remove provider wrapper)OptionListContextProvider,OptionsListContextProvider,OptionsListContext, oruseOptionsListacross the codebaseDepends 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
useOptionsListstill work (they should now useuseFilteredOptions)Issue Owner
Current Issue Owner: @shubham1206agra