/
githubmirror
/
gutenberg
Обзор
Документация
Войти
/
githubmirror
/
gutenberg
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
trunk
packages/editor/src/components/header/back-button.js
29 строк
655 B
Marco Ciampini
ESLint: Replace strict config with bulk suppressions (#81248)
07 авг 2026, 14:34
Не верифицирован
07 авг 2026, 14:34
7f43eaf
Код
Авторство
О чём код?
import { __experimentalUseSlotFills as useSlotFills, createSlotFill, } from '@wordpress/components'; // Keeping an old name for backward compatibility. const slotName = '__experimentalMainDashboardButton'; export const useHasBackButton = () => { const fills = useSlotFills( slotName ); return Boolean( fills && fills.length ); }; const { Fill, Slot } = createSlotFill( slotName ); const BackButton = Fill; const BackButtonSlot = () => { const fills = useSlotFills( slotName ); return ( <Slot bubblesVirtually fillProps={ { length: ! fills ? 0 : fills.length } } /> ); }; BackButton.Slot = BackButtonSlot; export default BackButton;