From 563df39fcaabe4e77ed69fe540f6bc14af1c0f5c Mon Sep 17 00:00:00 2001 From: Agata Kosior Date: Thu, 21 Dec 2023 09:40:25 +0100 Subject: [PATCH 1/2] fix: initialize state with empty objects --- src/pages/SearchPage.js | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/src/pages/SearchPage.js b/src/pages/SearchPage.js index d779ab856fb5..a2b955755121 100755 --- a/src/pages/SearchPage.js +++ b/src/pages/SearchPage.js @@ -45,18 +45,10 @@ const defaultProps = { function SearchPage({betas, personalDetails, reports, isSearchingForReports}) { const [searchValue, setSearchValue] = useState(''); - const [searchOptions, setSearchOptions] = useState(() => { - const { - recentReports: localRecentReports, - personalDetails: localPersonalDetails, - userToInvite: localUserToInvite, - } = OptionsListUtils.getSearchOptions(reports, personalDetails, '', betas); - - return { - recentReports: localRecentReports, - personalDetails: localPersonalDetails, - userToInvite: localUserToInvite, - }; + const [searchOptions, setSearchOptions] = useState({ + recentReports: {}, + personalDetails: {}, + userToInvite: {}, }); const {isOffline} = useNetwork(); @@ -179,7 +171,7 @@ function SearchPage({betas, personalDetails, reports, isSearchingForReports}) { > {({didScreenTransitionEnd, safeAreaPaddingBottomStyle}) => ( <> - + Date: Thu, 21 Dec 2023 09:43:26 +0100 Subject: [PATCH 2/2] fix: run prettier --- src/pages/SearchPage.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/SearchPage.js b/src/pages/SearchPage.js index a2b955755121..8fa733903a43 100755 --- a/src/pages/SearchPage.js +++ b/src/pages/SearchPage.js @@ -171,7 +171,7 @@ function SearchPage({betas, personalDetails, reports, isSearchingForReports}) { > {({didScreenTransitionEnd, safeAreaPaddingBottomStyle}) => ( <> - +