Skip to content

Commit ec32151

Browse files
committed
[fix] 빌드에러
1 parent 92498c5 commit ec32151

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/shared/components/header/DropdownMenu.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import Close from '@/shared/assets/icons/close_32.svg';
66
import User from '@/shared/assets/icons/user_24.svg';
77
import Link from 'next/link';
88
import { usePathname } from 'next/navigation';
9-
import { useEffect, useRef } from 'react';
9+
import { useEffect, useRef, useState } from 'react';
1010
import gsap from 'gsap';
1111
import { useAuthStore } from '@/shared/@store/auth';
1212
import { createPortal } from 'react-dom';
@@ -24,9 +24,14 @@ function DropdownMenu({ isClicked, setIsClicked, visible, setVisible }: Props) {
2424
const menuRef = useRef<HTMLDivElement>(null);
2525
const textRef = useRef<(HTMLSpanElement | null)[]>([]);
2626
const tlRef = useRef<GSAPTimeline | null>(null);
27+
const [mounted, setMounted] = useState(false);
2728

2829
const { isLoggedIn, logout } = useAuthStore();
2930

31+
useEffect(() => {
32+
setMounted(true);
33+
}, []);
34+
3035
useEffect(() => {
3136
if (!menuRef.current) return;
3237
if (!tlRef.current) {
@@ -58,6 +63,8 @@ function DropdownMenu({ isClicked, setIsClicked, visible, setVisible }: Props) {
5863
};
5964
}, [isClicked]);
6065

66+
if (!mounted) return null;
67+
6168
// const handleMouseEnter = (index: number) => {
6269
// const el = textRef.current[index];
6370
// if (!el) return;

0 commit comments

Comments
 (0)