editor: fix queueMicrotask causing hang

This commit is contained in:
Abdullah Atta
2024-10-17 11:13:00 +05:00
parent dd1f598393
commit c27e5c04ff

View File

@@ -44,11 +44,9 @@ export class PortalProviderAPI extends EventDispatcher<Portals> {
}
render(Component: FunctionComponent, container: HTMLElement) {
queueMicrotask(() => {
const root = this.roots.get(container) || createRoot(container);
flushSync(() => root.render(<Component />));
this.roots.set(container, root);
});
const root = this.roots.get(container) || createRoot(container);
flushSync(() => root.render(<Component />));
this.roots.set(container, root);
}
remove(container: HTMLElement) {