Skip to content

Commit 575bab9

Browse files
committed
fix(modal): do not remove container from body if it has not been included yet
1 parent d866b47 commit 575bab9

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/dialog/ModalPortal.jsx

+4
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ export function ModalPortal({ children, isOpen }) {
1616
}
1717

1818
return () => {
19+
if (!container) {
20+
return;
21+
}
22+
1923
body.removeChild(container);
2024
};
2125
}, []);

0 commit comments

Comments
 (0)