UNPKG

@wordpress/components

Version:
20 lines (19 loc) 573 B
import { forwardRef, useContext } from "@wordpress/element"; import { Context } from "./context"; import * as Styled from "./styles"; import { jsx as _jsx } from "react/jsx-runtime"; const ItemLabel = forwardRef(function ItemLabel2(props, ref) { const menuContext = useContext(Context); if (!menuContext?.store) { throw new Error("Menu.ItemLabel can only be rendered inside a Menu component"); } return /* @__PURE__ */ _jsx(Styled.ItemLabel, { numberOfLines: 1, ref, ...props }); }); export { ItemLabel }; //# sourceMappingURL=item-label.js.map