diff --git a/components/Modal/Modal.tsx b/components/Modal/Modal.tsx index 80a5dc8..daa58c3 100644 --- a/components/Modal/Modal.tsx +++ b/components/Modal/Modal.tsx @@ -164,7 +164,12 @@ const renderModal = (props: IModalComponentProps) => { }; const closeModal = (modal: HTMLElement) => { - document.body.removeChild(modal); + try { + document.body.removeChild(modal); + } catch (error) { + return false; + } + return true; }; export default {