UNPKG

react-atom-toast

Version:
21 lines (18 loc) 530 B
import { __async } from './chunk-5USKE2QT.js'; import { createRoot } from 'react-dom/client'; var MARK = "__react_root__"; function mount(node, container) { const root = container[MARK] || createRoot(container); root.render(node); container[MARK] = root; } function unmount(container) { return __async(this, null, function* () { return Promise.resolve().then(() => { var _a; (_a = container[MARK]) == null ? void 0 : _a.unmount(); delete container[MARK]; }); }); } export { mount, unmount };