/
githubmirror
/
gutenberg
Обзор
Документация
Войти
/
githubmirror
/
gutenberg
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
trunk
packages/components/src/scrollable/component.tsx
34 строки
976 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 { useScrollable } from './hook'; import type { ScrollableProps } from './types'; function UnconnectedScrollable( props: WordPressComponentProps< ScrollableProps, 'div' >, forwardedRef: ForwardedRef< any > ) { const scrollableProps = useScrollable( props ); return <View { ...scrollableProps } ref={ forwardedRef } />; } /** * `Scrollable` is a layout component that content in a scrollable container. * * ```jsx * import { __experimentalScrollable as Scrollable } from `@wordpress/components`; * * function Example() { * return ( * <Scrollable style={ { maxHeight: 200 } }> * <div style={ { height: 500 } }>...</div> * </Scrollable> * ); * } * ``` */ export const Scrollable = contextConnect( UnconnectedScrollable, 'Scrollable' ); export default Scrollable;