Skip to content

Commit

Permalink
editor: fix queueMicrotask causing hang
Browse files Browse the repository at this point in the history
  • Loading branch information
thecodrr committed Oct 17, 2024
1 parent 08c9233 commit f6f644c
Showing 1 changed file with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit f6f644c

Please sign in to comment.