(null);
useEffect(() => {
if (!portalRef) {
const div = document.createElement("div");
div.className = "toast-container theme-container";
document.body.appendChild(div);
setPortalRef(div);
}
}, [portalRef]);
if (!portalRef) {
return null;
}
return createPortal(
{toasts.map((toast) => (
dispatch(toast.id)} />
))}
,
portalRef,
);
}