From 4f2d01ba24de8fd1bb26b2628c300dea0d83db35 Mon Sep 17 00:00:00 2001 From: Noah Hernandez <63211322+oahnh@users.noreply.github.com> Date: Sun, 26 May 2024 16:19:03 -0700 Subject: [PATCH] fix: remove news state dependency from useEffect --- src/app/news/page.tsx | 2 +- .../HomePageComponents/HomeNewsFeed/HomeNewsFeed.tsx | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/app/news/page.tsx b/src/app/news/page.tsx index bc438877..a7e116be 100644 --- a/src/app/news/page.tsx +++ b/src/app/news/page.tsx @@ -24,7 +24,7 @@ export default function App() { setNews(fetchedNews); }; getNews(); - }, [news]); + }, []); return (
diff --git a/src/components/userComponents/HomePageComponents/HomeNewsFeed/HomeNewsFeed.tsx b/src/components/userComponents/HomePageComponents/HomeNewsFeed/HomeNewsFeed.tsx index 863392d9..70ffb0f5 100644 --- a/src/components/userComponents/HomePageComponents/HomeNewsFeed/HomeNewsFeed.tsx +++ b/src/components/userComponents/HomePageComponents/HomeNewsFeed/HomeNewsFeed.tsx @@ -23,12 +23,12 @@ function HomeNewsFeed() { setNews(topThreeNews); }; getNews(); - }, [news]); + }, []); return (
{isWebDevice && (