From 72bf9191935a8ced563ef2a9e42bffc2d246a78d Mon Sep 17 00:00:00 2001 From: Spencer Schoeneman Date: Fri, 1 Dec 2023 14:45:01 -0600 Subject: [PATCH] add more deps to deps arrays --- .../nextjs/components/dash-wind/features/leads/index.tsx | 2 +- .../components/dash-wind/features/transactions/index.tsx | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/nextjs/components/dash-wind/features/leads/index.tsx b/packages/nextjs/components/dash-wind/features/leads/index.tsx index 9b3f023..18bc66c 100644 --- a/packages/nextjs/components/dash-wind/features/leads/index.tsx +++ b/packages/nextjs/components/dash-wind/features/leads/index.tsx @@ -31,7 +31,7 @@ function Leads() { useEffect(() => { dispatch(getLeadsContent()); - }, []); + }, [dispatch]); const getDummyStatus = (index: number) => { if (index % 5 === 0) return
Not Interested
; diff --git a/packages/nextjs/components/dash-wind/features/transactions/index.tsx b/packages/nextjs/components/dash-wind/features/transactions/index.tsx index cd1c3e8..593b404 100644 --- a/packages/nextjs/components/dash-wind/features/transactions/index.tsx +++ b/packages/nextjs/components/dash-wind/features/transactions/index.tsx @@ -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"; @@ -25,11 +25,11 @@ const TopSideButtons = ({ removeFilter, applyFilter, applySearch }: TopSideButto setFilterParam(params); }; - const removeAppliedFilter = () => { + const removeAppliedFilter = useCallback(() => { removeFilter(); setFilterParam(""); setSearchText(""); - }; + }, [removeFilter]); useEffect(() => { if (searchText == "") { @@ -37,7 +37,7 @@ const TopSideButtons = ({ removeFilter, applyFilter, applySearch }: TopSideButto } else { applySearch(searchText); } - }, [searchText]); + }, [applySearch, removeAppliedFilter, searchText]); return (