/
githubmirror
/
gutenberg
Обзор
Документация
Войти
/
githubmirror
/
gutenberg
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
trunk
packages/components/src/button/deprecated.tsx
38 строк
989 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 deprecated from '@wordpress/deprecated'; import { forwardRef } from '@wordpress/element'; import Button from '.'; import type { DeprecatedIconButtonProps } from './types'; function UnforwardedIconButton( { label, labelPosition, size, tooltip, ...props }: React.ComponentPropsWithoutRef< typeof Button > & DeprecatedIconButtonProps, ref: ForwardedRef< any > ) { deprecated( 'wp.components.IconButton', { since: '5.4', alternative: 'wp.components.Button', version: '6.2', } ); return ( // Disable reason: the parent component is taking care of the __next40pxDefaultSize prop. // eslint-disable-next-line @wordpress/components-no-missing-40px-size-prop <Button { ...props } ref={ ref } tooltipPosition={ labelPosition } iconSize={ size } showTooltip={ tooltip !== undefined ? !! tooltip : undefined } label={ tooltip || label } /> ); } export default forwardRef( UnforwardedIconButton );