export const domPortal = (target) => {
    return (element) => {
        const finalTarget = target ?? document.body;
        finalTarget.append(element);
        return () => {
            element.remove();
        };
    };
};
