From 85c9b7575995d05ba996ce060d2e29f2501fca53 Mon Sep 17 00:00:00 2001 From: Sohyun Park <124856726+ParkSohyunee@users.noreply.github.com> Date: Tue, 17 Dec 2024 12:26:18 +0900 Subject: [PATCH] =?UTF-8?q?Style:=20=ED=94=84=EB=A1=9C=ED=95=84=20?= =?UTF-8?q?=ED=8E=98=EC=9D=B4=EC=A7=80=20=EC=82=AC=EC=9A=A9=ED=95=98?= =?UTF-8?q?=EC=A7=80=20=EC=95=8A=EB=8A=94=20import=EB=AC=B8=20=EC=A0=9C?= =?UTF-8?q?=EA=B1=B0=20=EB=B0=8F=20useEffect=20=EC=9D=98=EC=A1=B4=EC=84=B1?= =?UTF-8?q?=20=EB=B0=B0=EC=97=B4=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/account/profile/_components/ProfileForm.tsx | 2 +- src/app/account/profile/_components/ProfileSkeleton.tsx | 2 -- src/app/account/profile/page.tsx | 3 ++- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/app/account/profile/_components/ProfileForm.tsx b/src/app/account/profile/_components/ProfileForm.tsx index 385580d7..4d678a73 100644 --- a/src/app/account/profile/_components/ProfileForm.tsx +++ b/src/app/account/profile/_components/ProfileForm.tsx @@ -164,7 +164,7 @@ export default function ProfileForm({ useEffect(() => { setSelectedBackground(getValues('backgroundImageUrl') as string); setSelectedProfile(getValues('profileImageUrl') as string); - }, []); + }, [getValues]); return ( <> diff --git a/src/app/account/profile/_components/ProfileSkeleton.tsx b/src/app/account/profile/_components/ProfileSkeleton.tsx index 0da9eff2..870a6480 100644 --- a/src/app/account/profile/_components/ProfileSkeleton.tsx +++ b/src/app/account/profile/_components/ProfileSkeleton.tsx @@ -1,6 +1,4 @@ import Skeleton from '@/components/Skeleton/Skeleton'; -import * as pageStyles from '../page.css'; -import * as previewStyles from './ImagePreview.css'; import * as styles from './ProfileForm.css'; const NUMBER_OF_BACKGROUND_OPTIONS = 8; diff --git a/src/app/account/profile/page.tsx b/src/app/account/profile/page.tsx index 17f08bb1..ee1b714e 100644 --- a/src/app/account/profile/page.tsx +++ b/src/app/account/profile/page.tsx @@ -1,4 +1,5 @@ 'use client'; + import { useEffect, useState } from 'react'; import { FormProvider, useForm } from 'react-hook-form'; import { useMutation, useQuery, useQueryClient } from '@tanstack/react-query'; @@ -54,7 +55,7 @@ export default function ProfilePage() { }); setProfilePreviewUrl(userData?.profileImageUrl ?? ''); setBackgroundPreviewUrl(userData?.backgroundImageUrl ?? ''); - }, [userData]); + }, [userData, methods]); //미리보기 이미지 변경 const handleProfilePreviewChange = async (image: File | string) => {