Skip to content

Commit

Permalink
add more deps to deps arrays
Browse files Browse the repository at this point in the history
  • Loading branch information
Spencer-Sch committed Dec 1, 2023
1 parent 7836ed7 commit 72bf919
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ function Leads() {

useEffect(() => {
dispatch(getLeadsContent());
}, []);
}, [dispatch]);

const getDummyStatus = (index: number) => {
if (index % 5 === 0) return <div className="badge">Not Interested</div>;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useEffect, useState } from "react";
import { useCallback, useEffect, useState } from "react";
// import Image from "next/image";
import TitleCard from "../../components/Cards/TitleCard";
import SearchBar from "../../components/Input/SearchBar";
Expand All @@ -25,19 +25,19 @@ const TopSideButtons = ({ removeFilter, applyFilter, applySearch }: TopSideButto
setFilterParam(params);
};

const removeAppliedFilter = () => {
const removeAppliedFilter = useCallback(() => {
removeFilter();
setFilterParam("");
setSearchText("");
};
}, [removeFilter]);

useEffect(() => {
if (searchText == "") {
removeAppliedFilter();
} else {
applySearch(searchText);
}
}, [searchText]);
}, [applySearch, removeAppliedFilter, searchText]);

return (
<div className="inline-block float-right">
Expand Down

0 comments on commit 72bf919

Please sign in to comment.