UNPKG

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

Version:
25 lines (20 loc) 500 B
'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); var reactDom = require('react-dom'); var usePortal = require('../../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.default(id); return reactDom.createPortal(children, target); }; exports.default = Portal;