UNPKG

@wordpress/components

Version:
36 lines (31 loc) 874 B
import _extends from "@babel/runtime/helpers/esm/extends"; import { createElement } from "@wordpress/element"; /** * External dependencies */ /** * Internal dependencies */ import { contextConnect } from '../ui/context'; import { View } from '../view'; import { useHeading } from './hook'; function UnconnectedHeading(props, forwardedRef) { const headerProps = useHeading(props); return createElement(View, _extends({}, headerProps, { ref: forwardedRef })); } /** * `Heading` renders headings and titles using the library's typography system. * * ```jsx * import { __experimentalHeading as Heading } from "@wordpress/components"; * * function Example() { * return <Heading>Code is Poetry</Heading>; * } * ``` */ export const Heading = contextConnect(UnconnectedHeading, 'Heading'); export default Heading; //# sourceMappingURL=component.js.map