Skip to content

Commit

Permalink
fix: index.html에 스크립트 코드 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
pepperdad committed Aug 31, 2024
1 parent 9f375db commit 536a611
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 11 deletions.
1 change: 1 addition & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
<script src="/deployLoading.js"></script>
<script>
(function () {
if ("serviceWorker" in navigator) {
Expand Down
11 changes: 0 additions & 11 deletions src/pages/main/Main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,17 +59,6 @@ const Main = () => {
}
};

useEffect(() => {
const script = document.createElement("script");
script.src = `${import.meta.env.VITE_CLIENT_URL}/deployLoading.js`;
script.async = true;
document.body.appendChild(script);

return () => {
document.body.removeChild(script); // 컴포넌트 언마운트 시 스크립트 제거
};
}, []);

if (isLoading) {
return <Loading />;
}
Expand Down

0 comments on commit 536a611

Please sign in to comment.