diff --git a/src/index.tsx b/src/index.tsx index 546e735..d276105 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -280,7 +280,8 @@ export function hide(modal: string | React.FC) { return hideModalCallbacks[modalId].promise; } -export const remove = (modalId: string): void => { +export const remove = (modal: string | React.FC): void => { + const modalId = getModalId(modal); dispatch(removeModal(modalId)); delete modalCallbacks[modalId]; delete hideModalCallbacks[modalId];