UNPKG

@wordpress/components

Version:
24 lines (22 loc) 625 B
/** * WordPress dependencies */ import { forwardRef, useContext } from '@wordpress/element'; /** * Internal dependencies */ import { Context } from './context'; import * as Styled from './styles'; import { jsx as _jsx } from "react/jsx-runtime"; export const ItemLabel = forwardRef(function ItemLabel(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: ref, ...props }); }); //# sourceMappingURL=item-label.js.map