/
githubmirror
/
gutenberg
Обзор
Документация
Войти
/
githubmirror
/
gutenberg
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
trunk
packages/components/src/heading/component.tsx
30 строк
850 B
Marco Ciampini
ESLint: Replace strict config with bulk suppressions (#81248)
07 авг 2026, 14:34
Не верифицирован
07 авг 2026, 14:34
7f43eaf
Код
Авторство
О чём код?
import type { ForwardedRef } from 'react'; import type { WordPressComponentProps } from '../context'; import { contextConnect } from '../context'; import { View } from '../view'; import { useHeading } from './hook'; import type { HeadingProps } from './types'; function UnconnectedHeading( props: WordPressComponentProps< HeadingProps, 'h1' >, forwardedRef: ForwardedRef< any > ) { const headerProps = useHeading( props ); return <View { ...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;