/
githubmirror
/
gutenberg
Обзор
Документация
Войти
/
githubmirror
/
gutenberg
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
trunk
packages/components/src/text/component.tsx
37 строк
937 B
Marco Ciampini
ESLint: Replace strict config with bulk suppressions (#81248)
07 авг 2026, 14:34
Не верифицирован
07 авг 2026, 14:34
7f43eaf
Код
Авторство
О чём код?
import type { WordPressComponentProps } from '../context'; import { contextConnect } from '../context'; import { View } from '../view'; import useText from './hook'; import type { Props } from './types'; /** * @param props * @param forwardedRef */ function UnconnectedText( props: WordPressComponentProps< Props, 'span' >, forwardedRef: React.ForwardedRef< any > ) { const textProps = useText( props ); return <View as="span" { ...textProps } ref={ forwardedRef } />; } /** * `Text` is a core component that renders text in the library, using the * library's typography system. * * `Text` can be used to render any text-content, like an HTML `p` or `span`. * * @example * * ```jsx * import { __experimentalText as Text } from `@wordpress/components`; * * function Example() { * return <Text>Code is Poetry</Text>; * } * ``` */ export const Text = contextConnect( UnconnectedText, 'Text' ); export default Text;