diff --git a/src/App.tsx b/src/App.tsx index 1f8719f..c856b36 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -220,7 +220,7 @@ function App() { const retval: Array = []; if (!searchQuery) { - setSearchResults(retval); + setSearchResults([]); setSearchResultData({ type: 'FeatureCollection', features: [] @@ -229,7 +229,7 @@ function App() { } if (buildingPointData) { - let locationResults = buildingPointData.features.filter((e: any) => { + const locationResults = buildingPointData.features.filter((e: any) => { const includesName = e!.properties!.Name.toLowerCase().includes(searchQuery.toLowerCase()); const includesAbbr = e!.properties!.Abbrev.toLowerCase() === searchQuery.toLowerCase(); const includesBldgNum = e!.properties!.BldgNum.toLowerCase() === searchQuery.toLowerCase(); @@ -243,10 +243,10 @@ function App() { clearVisibility(); } - setSearchResults(retval); + setSearchResults([...retval]); setSearchResultData({ type: 'FeatureCollection', - features: retval + features: [...retval] }); }; diff --git a/src/components/SearchResults.tsx b/src/components/SearchResults.tsx index e0ce8a6..05ad278 100644 --- a/src/components/SearchResults.tsx +++ b/src/components/SearchResults.tsx @@ -74,7 +74,7 @@ export default function SearchResults(props: SearchResultsProps) {