diff --git a/src/components/SearchInput/SearchInput.tsx b/src/components/SearchInput/SearchInput.tsx index d6d15d5..f407d25 100644 --- a/src/components/SearchInput/SearchInput.tsx +++ b/src/components/SearchInput/SearchInput.tsx @@ -15,10 +15,12 @@ const SearchInput: React.FC = () => { /* eslint-disable react-hooks/exhaustive-deps */ useEffect(() => { + let isMounted = true; if (value !== query) { - setValue(query); + isMounted && setValue(query); ReactGA.event({ category: "Search", action: "Tag", label: query }); } + return () => void (isMounted = false); }, [query]); /* eslint-enable react-hooks/exhaustive-deps */