Skip to content

Commit

Permalink
refactor : kakao 상태 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
qkdl60 committed May 13, 2024
1 parent 5442dc3 commit 1b5cd98
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/components/KakaoShareButton/KakaoShareButton.tsx
Original file line number Diff line number Diff line change
@@ -1,17 +1,18 @@
'use client';

import Image from 'next/image';
import { useEffect } from 'react';
import { useEffect, useState } from 'react';
import './index.scss';

interface KakaoShareButtonProps {}
export default function KakaoShareButton({}: KakaoShareButtonProps) {
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const kakao = (window as any).Kakao;
const currentURL = window.location.href;
const [currentURL, setCurrentURL] = useState<string>('');
useEffect(() => {
kakao?.cleanup();
kakao?.init(process.env.NEXT_PUBLIC_KAKAO_JAVASCRIPT_KEY);
setCurrentURL(window.location.href);
return () => {
kakao?.cleanup();
};
Expand Down

0 comments on commit 1b5cd98

Please sign in to comment.