-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Open
Labels
Awaiting PaymentAuto-added when associated PR is deployed to productionAuto-added when associated PR is deployed to productionTaskWeeklyKSv2KSv2
Description
Problem
RoomInvitePage.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,areOptionsInitialized - Called with: no arguments (defaults to
shouldInitialize: true) - File:
src/pages/RoomInvitePage.tsx
How options are used:
options.personalDetailsis passed togetMemberInviteOptions()to build invite optionsareOptionsInitializedguards early return ingetDefaultOptions(), section building, andshowLoadingPlaceholder
Migration steps:
- Replace
import {useOptionsList} from '@components/OptionListContextProvider'withimport useFilteredOptions from '@hooks/useFilteredOptions' - Replace
useOptionsList()call withuseFilteredOptions({ enabled: true })(or tie to screen transition if applicable) - Replace
areOptionsInitializedwith!isLoading(oroptions !== null) - Update
getDefaultOptions()guard, section building guard, andshowLoadingPlaceholderaccordingly - Handle the
nulloptions case ingetMemberInviteOptions()call
Complexity: Simple-Medium
Reference PR: #74071
Tests
- Verify room invite flow works correctly (invite members to a room)
- Verify the member list populates correctly
- Verify search/filter within the invite page works
- Verify loading placeholders show correctly while options compute
- Verify no errors appear in the JS console
- Test on all platforms (iOS, Android, Web, Desktop)
Reactions are currently unavailable
Metadata
Metadata
Labels
Awaiting PaymentAuto-added when associated PR is deployed to productionAuto-added when associated PR is deployed to productionTaskWeeklyKSv2KSv2