Skip to content

Commit

Permalink
🐛 Fix : hook 호출 장애물 early return 삭제
Browse files Browse the repository at this point in the history
  • Loading branch information
kimjuyoung99 committed Dec 9, 2024
1 parent e0c7c68 commit 52c9f3b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/apis/family/fetchFamilyDDang.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { AxiosError } from 'axios'
import { APIResponse, CommonAPIResponse, ErrorResponse, Member } from '~types/api'
import { APIResponse, CommonAPIResponse, ErrorResponse } from '~types/api'
import { axiosInstance } from '~apis/axiosInstance'
import { DayOfWeek } from '~types/common'

Expand Down
8 changes: 4 additions & 4 deletions src/modals/OwnerUpdateModal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,6 @@ export default function OwnerUpdateModal() {
}
}, [data])

Check warning on line 52 in src/modals/OwnerUpdateModal/index.tsx

View workflow job for this annotation

GitHub Actions / lighthouse

React Hook useEffect has a missing dependency: 'ownerProfile'. Either include it or remove the dependency array

if (!ownerProfile) {
return null
}

const updateOwnerMutation = useMutation({
mutationFn: (data: UpdateOwnerProfileRequest) => updateOwnerProfile(data),
onSuccess: () => {
Expand All @@ -79,6 +75,10 @@ export default function OwnerUpdateModal() {
}
}, [ownerProfile.profileImg]) // profileImg가 변경될 때마다 실행

if (!ownerProfile) {
return null
}

const handleRoleClick = () => {
pushModal(
<FamilyRoleChoiceModal
Expand Down

0 comments on commit 52c9f3b

Please sign in to comment.