diff --git a/app/about/components/quote/useIntersectionObserver.js b/app/about/components/quote/useIntersectionObserver.js index 8ffdd9b..0213997 100644 --- a/app/about/components/quote/useIntersectionObserver.js +++ b/app/about/components/quote/useIntersectionObserver.js @@ -17,13 +17,15 @@ export function useIntersectionObserver() { } ); - if (ref.current) { - observer.observe(ref.current); + const currentRef = ref.current; // Store the ref value in a variable + + if (currentRef) { + observer.observe(currentRef); } return () => { - if (ref.current) { - observer.unobserve(ref.current); + if (currentRef) { + observer.unobserve(currentRef); } }; }, []); diff --git a/components/Navbar.jsx b/components/Navbar.jsx index 6867e20..d7ede9b 100644 --- a/components/Navbar.jsx +++ b/components/Navbar.jsx @@ -99,7 +99,7 @@ const NavItems = ({ isNavOpen, setIsNavOpen }) => { type: "spring", stiffness: 400, damping: 40, - }, + }, }, }; @@ -111,7 +111,7 @@ const NavItems = ({ isNavOpen, setIsNavOpen }) => { animate={isNavOpen ? "open" : "closed"} initial={false}>