diff options
-rw-r--r-- | src/components/search/SearchResults.tsx | 19 | ||||
-rw-r--r-- | src/screens/search/SearchScreen.tsx | 2 |
2 files changed, 11 insertions, 10 deletions
diff --git a/src/components/search/SearchResults.tsx b/src/components/search/SearchResults.tsx index 9d95593a..bf355220 100644 --- a/src/components/search/SearchResults.tsx +++ b/src/components/search/SearchResults.tsx @@ -29,15 +29,16 @@ const SearchResults: React.FC<SearchResultsProps> = ({ } return ( <View style={containerStyle}> - {results.map((profilePreview) => ( - <ProfilePreview - style={styles.result} - key={profilePreview.id} - {...{profilePreview}} - previewType={previewType} - screenType={screenType} - /> - ))} + {results && + results.map((profilePreview) => ( + <ProfilePreview + style={styles.result} + key={profilePreview.id} + {...{profilePreview}} + previewType={previewType} + screenType={screenType} + /> + ))} </View> ); }; diff --git a/src/screens/search/SearchScreen.tsx b/src/screens/search/SearchScreen.tsx index b11f6a1a..78c0c5cc 100644 --- a/src/screens/search/SearchScreen.tsx +++ b/src/screens/search/SearchScreen.tsx @@ -37,7 +37,7 @@ const SearchScreen: React.FC = () => { const [query, setQuery] = useState<string>(''); const [results, setResults] = useState<Array<ProfilePreviewType>>([]); const [recents, setRecents] = useState<Array<ProfilePreviewType>>( - recentSearches, + recentSearches ?? [], ); const [searching, setSearching] = useState(false); const top = Animated.useValue(-SCREEN_HEIGHT); |