diff --git a/src/components/Library/Library.jsx b/src/components/Library/Library.jsx index 2435b13..8afca61 100644 --- a/src/components/Library/Library.jsx +++ b/src/components/Library/Library.jsx @@ -337,7 +337,7 @@ export default function Library({ filter, setFilter }) { setMyRows([]); setFilter(''); }; - }, [filter, myRows]); + }, [setFilter, filter, myRows]); useEffect(() => { fetchBooksFromDB(); diff --git a/src/pages/Home/Home.jsx b/src/pages/Home/Home.jsx index 2f5afbb..624bb9e 100644 --- a/src/pages/Home/Home.jsx +++ b/src/pages/Home/Home.jsx @@ -76,7 +76,7 @@ function Home() { } hasRun.current = true; //Toggle hasRun to true to prevent useEffect from running twice } - }, []); + }, [location.state]); const matches = useMediaQuery('(max-width:700px)'); return (