UNPKG

@boomerang-io/carbon-addons-boomerang-react

Version:
21 lines (18 loc) 410 B
import { createPortal } from 'react-dom'; import usePortal from '../../hooks/usePortal.js'; /* IBM Confidential 694970X, 69497O0 © Copyright IBM Corp. 2022, 2024 */ /** * @example * <Portal> * <p>Thinking with portals</p> * </Portal> */ const Portal = ({ id, children }) => { const target = usePortal(id); return createPortal(children, target); }; export { Portal as default };