/
githubmirror
/
gutenberg
Обзор
Документация
Войти
/
githubmirror
/
gutenberg
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
trunk
packages/components/src/grid/component.tsx
39 строк
945 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 useGrid from './hook'; import type { GridProps } from './types'; function UnconnectedGrid( props: WordPressComponentProps< GridProps, 'div' >, forwardedRef: ForwardedRef< any > ) { const gridProps = useGrid( props ); return <View { ...gridProps } ref={ forwardedRef } />; } /** * `Grid` is a primitive layout component that can arrange content in a grid configuration. * * ```jsx * import { * __experimentalGrid as Grid, * __experimentalText as Text * } from `@wordpress/components`; * * function Example() { * return ( * <Grid columns={ 3 }> * <Text>Code</Text> * <Text>is</Text> * <Text>Poetry</Text> * </Grid> * ); * } * ``` */ export const Grid = contextConnect( UnconnectedGrid, 'Grid' ); export default Grid;