Skip to content

Commit 0342b95

Browse files
committed
fix: build error - sessiongStorage 클라이언트 측에서만 실행
1 parent 2114029 commit 0342b95

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/app/quiz/finish/page.tsx

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,14 @@ const QuizFinishPage: React.FC = () => {
1717

1818
const { data, isLoading: isQuizLoading, isError } = useQuizScore();
1919
const [isLoading, setIsLoading] = useState(true);
20-
21-
// 세션 스토리지에서 값 제거
22-
sessionStorage.removeItem('insta');
23-
sessionStorage.removeItem('email');
20+
21+
useEffect(() => {
22+
// 클라이언트 측에서만 sessionStorage를 사용하도록 설정
23+
if (typeof window !== 'undefined') {
24+
sessionStorage.removeItem('insta');
25+
sessionStorage.removeItem('email');
26+
}
27+
}, []);
2428

2529
const scoreData: ScoreData | null = data
2630
? {

0 commit comments

Comments
 (0)