From 075eccdfceb8d4160c1d8986a7caa0fee31a4ad4 Mon Sep 17 00:00:00 2001 From: CuriousCorrelation Date: Thu, 21 Jul 2022 17:20:04 +0530 Subject: [PATCH] Change effect dependencies --- app/scenes/Search/index.tsx | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/app/scenes/Search/index.tsx b/app/scenes/Search/index.tsx index 69531bcb39..fb0d7a6edb 100644 --- a/app/scenes/Search/index.tsx +++ b/app/scenes/Search/index.tsx @@ -114,15 +114,15 @@ function Search(props: Props) { setCachedQuery(query); } }, [ + cachedQuery, collectionId, dateFilter, + documents, includeArchived, lastParams, - cachedQuery, offset, - documents, - searches, query, + searches, userId, ]); @@ -157,11 +157,11 @@ function Search(props: Props) { React.useEffect(() => { handleQueryChange(); - }, [handleQueryChange, search]); + }, [handleQueryChange]); React.useEffect(() => { handleTermChange(); - }, [handleTermChange, term]); + }, [handleTermChange]); const goBack = React.useCallback(() => { history.goBack(); @@ -244,11 +244,11 @@ function Search(props: Props) { // Fetch more results await fetchResults(); - }, [allowLoadMore, isLoading, fetchResults]); + }, [allowLoadMore, fetchResults, isLoading]); const handleEscape = React.useCallback(() => { searchInputRef?.current?.focus(); - }, [searchInputRef]); + }, []); const { notFound } = props; const results = documents.searchResults(query);