Skip to content

Commit

Permalink
Allow remove by modal component.
Browse files Browse the repository at this point in the history
  • Loading branch information
supnate committed Sep 27, 2023
1 parent 8ffa660 commit 7fa8bad
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,8 @@ export function hide(modal: string | React.FC<any>) {
return hideModalCallbacks[modalId].promise;
}

export const remove = (modalId: string): void => {
export const remove = (modal: string | React.FC<any>): void => {
const modalId = getModalId(modal);
dispatch(removeModal(modalId));
delete modalCallbacks[modalId];
delete hideModalCallbacks[modalId];
Expand Down

0 comments on commit 7fa8bad

Please sign in to comment.