diff --git a/frontend/src/business/hooks/useBlocker.ts b/frontend/src/business/hooks/useBlocker.ts index 5a9fb734..9aeff6fc 100644 --- a/frontend/src/business/hooks/useBlocker.ts +++ b/frontend/src/business/hooks/useBlocker.ts @@ -27,10 +27,7 @@ export function useBlocker({ when, onConfirm, onCancel }: useBlockerParams) { onConfirm?.(); }); }, - onCancel: ({ close }) => { - onCancel?.(); - close(); - }, + onCancel, }); return true; } diff --git a/frontend/src/business/hooks/usePopup/useExitPopup.tsx b/frontend/src/business/hooks/usePopup/useExitPopup.tsx index 0ef5a3c1..11868cca 100644 --- a/frontend/src/business/hooks/usePopup/useExitPopup.tsx +++ b/frontend/src/business/hooks/usePopup/useExitPopup.tsx @@ -4,7 +4,7 @@ import Popup from '@components/Popup'; interface openExitPopupParams { onConfirm: ({ close }: CloseFunc) => void; - onCancel?: ({ close }: CloseFunc) => void; + onCancel?: () => void; } export function useExitPopup() { @@ -15,7 +15,7 @@ export function useExitPopup() { onConfirm({ close })} - onCancel={() => onCancel?.({ close })} + onCancel={onCancel} >
나갈거야?
diff --git a/frontend/src/business/hooks/usePopup/usePasswordPopup.tsx b/frontend/src/business/hooks/usePopup/usePasswordPopup.tsx index c597aa84..8a1af7cb 100644 --- a/frontend/src/business/hooks/usePopup/usePasswordPopup.tsx +++ b/frontend/src/business/hooks/usePopup/usePasswordPopup.tsx @@ -18,7 +18,7 @@ export function usePasswordPopup() { open(({ close: closePopup }) => ( { onSubmit?.({ password, closePopup }); diff --git a/frontend/src/components/Popup/Popup.tsx b/frontend/src/components/Popup/Popup.tsx index 6b5dd3f3..66404739 100644 --- a/frontend/src/components/Popup/Popup.tsx +++ b/frontend/src/components/Popup/Popup.tsx @@ -7,7 +7,7 @@ interface PopupProps { children: React.ReactNode; } -export default function Popup({ onCancel, onConfirm, children }: PopupProps) { +export default function Popup({ close, onCancel, onConfirm, children }: PopupProps) { const closeWithCancel = () => { onCancel?.(); close();