Browse Source

fix(blog): cleanup unnecessary effect

Signed-off-by: Muthu Kumar <muthukumar@thefeathers.in>
pull/1/head
Muthu Kumar 2 years ago
parent
commit
6537b2a089
Signed by: mkrhere GPG Key ID: 3FD688398897097E
  1. 7
      src/pages/blog/Home.tsx

7
src/pages/blog/Home.tsx

@ -59,12 +59,7 @@ const BlogHome: React.FC = () => {
const location = useLocation();
const isArticleOpen = Boolean(location.pathname.split("/blog")[1]);
const [isAsideClosed, setAsideClosed] = useState(false);
useEffect(() => {
if (isArticleOpen) setAsideClosed(true);
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);
const [isAsideClosed, setAsideClosed] = useState(isArticleOpen);
useEffect(() => {
if (!isArticleOpen) setAsideClosed(false);

Loading…
Cancel
Save