diff --git a/web/modals/threads/thread-picker-modal.react.js b/web/modals/threads/thread-picker-modal.react.js --- a/web/modals/threads/thread-picker-modal.react.js +++ b/web/modals/threads/thread-picker-modal.react.js @@ -2,7 +2,6 @@ import invariant from 'invariant'; import * as React from 'react'; -import { createSelector } from 'reselect'; import { useGlobalThreadSearchIndex } from 'lib/selectors/nav-selectors.js'; import { onScreenEntryEditableThreadInfos } from 'lib/selectors/thread-selectors.js'; @@ -81,26 +80,12 @@ [searchIndex], ); - const listDataSelector = createSelector( - state => state.onScreenThreadInfos, - state => state.searchText, - state => state.searchResults, - ( - threadInfos: $ReadOnlyArray, - text: string, - results: Set, - ) => - text - ? threadInfos.filter(threadInfo => results.has(threadInfo.id)) - : [...threadInfos], - ); - - const threads = useSelector(() => - listDataSelector({ - onScreenThreadInfos, - searchText, - searchResults, - }), + const threads = React.useMemo( + () => + searchText + ? onScreenThreadInfos.filter(thread => searchResults.has(thread.id)) + : onScreenThreadInfos, + [searchText, onScreenThreadInfos, searchResults], ); const threadPickerContent = React.useMemo(() => {