Skip to content

Commit 62cf105

Browse files
lethemanhrezk2ll
authored andcommitted
fix: Reorganize virtualized grid list to render item content 🐛
1 parent 1421321 commit 62cf105

File tree

2 files changed

+3
-5
lines changed

2 files changed

+3
-5
lines changed

react/GridList/Virtualized/Dnd/index.jsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,21 +41,20 @@ const VirtualizedGridListDnd = ({
4141
<div {...scrollerProps} ref={ref} />
4242
</DnDConfigWrapper>
4343
)),
44-
Item: ({ context, children, ...props }) => {
44+
Item: ({ context, ...props }) => {
4545
const item = context?.items?.[props['data-index']]
4646
return (
4747
<GridItem
4848
item={item}
4949
context={context}
50-
renderItem={() => <>{children}</>}
50+
renderItem={itemRenderer}
5151
{...componentProps.Item}
5252
/>
5353
)
5454
},
5555
...components
5656
}}
5757
context={_context}
58-
itemRenderer={itemRenderer}
5958
{...props}
6059
>
6160
{children}

react/GridList/Virtualized/index.jsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,14 @@ import React, { forwardRef } from 'react'
22
import { VirtuosoGrid } from 'react-virtuoso'
33

44
const VirtualizedGridList = forwardRef(
5-
({ items = [], itemRenderer, components, context, ...props }, ref) => {
5+
({ items = [], components, context, ...props }, ref) => {
66
return (
77
<VirtuosoGrid
88
ref={ref}
99
components={components}
1010
context={context}
1111
style={{ height: '100%' }}
1212
totalCount={items.length}
13-
itemContent={index => itemRenderer(items[index])}
1413
{...props}
1514
/>
1615
)

0 commit comments

Comments
 (0)