Change effect dependencies

This commit is contained in:
CuriousCorrelation committed 2022-07-21 17:20:04 +05:30
1 parent 24a9f7450c
commit 075eccdfce
1 file changed
+7 -7
+7 -7
View File
@@ -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);