@lobehub/editor
Version:
A powerful and extensible rich text editor built on Meta's Lexical framework, providing a modern editing experience with React integration.
12 lines (11 loc) • 384 B
JavaScript
'use client';
import { createPortal } from 'react-dom';
import { useAnchor } from "./useAnchor";
var PortalAnchor = function PortalAnchor(_ref) {
var children = _ref.children;
var targetElement = useAnchor();
if (!targetElement) return null;
return /*#__PURE__*/createPortal(children, targetElement);
};
PortalAnchor.displayName = 'PortalAnchor';
export default PortalAnchor;