fix: note broadcaster bug / createPortal for modal

This commit is contained in:
2023-10-21 21:45:50 +01:00
parent c1ea68b296
commit 0e3661afc6
5 changed files with 37 additions and 39 deletions

View File

@ -1,4 +1,5 @@
import { ReactNode, useSyncExternalStore } from "react";
import { createPortal } from "react-dom";
import { v4 as uuid } from "uuid";
import { ExternalStore, unixNow } from "@snort/shared";
@ -42,7 +43,7 @@ export default function Toaster() {
() => Toastore.snapshot(),
);
return (
return createPortal(
<div className="toaster">
{toast.map(a => (
<div className="card flex" key={a.id}>
@ -50,6 +51,5 @@ export default function Toaster() {
{a.element}
</div>
))}
</div>
);
</div>, document.body);
}