UNPKG

@wordpress/edit-post

Version:
31 lines (26 loc) 709 B
import { createElement } from "@wordpress/element"; /** * WordPress dependencies */ import { __experimentalUseSlot as useSlot, createSlotFill } from '@wordpress/components'; const slotName = '__experimentalMainDashboardButton'; const { Fill, Slot: MainDashboardButtonSlot } = createSlotFill(slotName); const MainDashboardButton = Fill; const Slot = ({ children }) => { const slot = useSlot(slotName); const hasFills = Boolean(slot.fills && slot.fills.length); if (!hasFills) { return children; } return createElement(MainDashboardButtonSlot, { bubblesVirtually: true }); }; MainDashboardButton.Slot = Slot; export default MainDashboardButton; //# sourceMappingURL=index.js.map