@boomerang-io/carbon-addons-boomerang-react
Version:
Carbon Addons for Boomerang apps
21 lines (18 loc) • 410 B
JavaScript
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 };