UNPKG

@shopgate/engage

Version:
23 lines (22 loc) 624 B
import React from 'react'; import PropTypes from 'prop-types'; import { createPortal } from 'react-dom'; import { SnackBar } from '@shopgate/pwa-ui-material'; /** * The SnackBarContainer component. * @param {Object} props The component props. * @returns {JSX.Element|null} */ import { jsx as _jsx } from "react/jsx-runtime"; function SnackBarContainer(props) { if (!props.toasts.length) { return null; } return /*#__PURE__*/createPortal(/*#__PURE__*/_jsx(SnackBar, { ...props }), document.getElementById('portals')); } SnackBarContainer.defaultProps = { toasts: [] }; export default SnackBarContainer;