diff --git a/src/frontend/index.tsx b/src/frontend/index.tsx index 1970e9d..1b3e86d 100644 --- a/src/frontend/index.tsx +++ b/src/frontend/index.tsx @@ -113,38 +113,37 @@ const AppRoot = () => { url: 'https://mor.org', base64Icon: LOGO_METAMASK_BASE64, }, + modals: { install: ({ link }) => { let modalContainer: HTMLElement; return { mount: () => { - if (modalContainer) return; - modalContainer = document.createElement('div'); modalContainer.id = 'meta-mask-modal-container'; document.body.appendChild(modalContainer); - ReactDOM.render( + const modalRoot = createRoot(modalContainer); + + modalRoot.render( { - ReactDOM.unmountComponentAtNode(modalContainer); + modalRoot.unmount(); modalContainer.remove(); }} />, - modalContainer, ); setTimeout(() => { updateQrCode(link); }, 100); }, + unmount: () => { if (modalContainer) { - ReactDOM.unmountComponentAtNode(modalContainer); - modalContainer.remove(); } },