/
githubmirror
/
material-ui
Обзор
Документация
Войти
/
githubmirror
/
material-ui
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
docs/data/material/components/lists/VirtualizedList.tsx
37 строк
941 B
Brijesh Bittu
[code-infra] Remove React import requirement for jsx (#47146)
29 окт 2025, 20:55
Не верифицирован
29 окт 2025, 20:55
6c9e82f
Код
Авторство
О чём код?
import Box from '@mui/material/Box'; import ListItem from '@mui/material/ListItem'; import ListItemButton from '@mui/material/ListItemButton'; import ListItemText from '@mui/material/ListItemText'; import { List, RowComponentProps } from 'react-window'; function renderRow(props: RowComponentProps) { const { index, style } = props; return ( <ListItem style={style} key={index} component="div" disablePadding> <ListItemButton> <ListItemText primary={`Item ${index + 1}`} /> </ListItemButton> </ListItem> ); } export default function VirtualizedList() { return ( <Box sx={{ width: '100%', height: 400, maxWidth: 360, bgcolor: 'background.paper' }} > <List rowHeight={46} rowCount={200} style={{ height: 400, width: 360, }} rowProps={{}} overscanCount={5} rowComponent={renderRow} /> </Box> ); }