You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It appears that in the current MasonryHorizontalVirtualizerVariable component, the component is receiving a prop named "rows" from the external environment, but internally, it is being used as "columns." While there doesn't seem to be any issues with the code execution, I believe it would be beneficial to improve readability and consistency by renaming the prop.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
It appears that in the current MasonryHorizontalVirtualizerVariable component, the component is receiving a prop named "rows" from the external environment, but internally, it is being used as "columns." While there doesn't seem to be any issues with the code execution, I believe it would be beneficial to improve readability and consistency by renaming the prop.
AS-IS
function MasonryHorizontalVirtualizerVariable({ rows }){
...
const columnVirtualizer = useVirtualizer({
horizontal: true,
count: columns.length,
getScrollElement: () => parentRef.current,
estimateSize: (i) => columns[i],
overscan: 5,
lanes: 4,
})
...
}
TO-BE
function MasonryHorizontalVirtualizerVariable({ columns }) {
...
const columnVirtualizer = useVirtualizer({
horizontal: true,
count: columns.length,
getScrollElement: () => parentRef.current,
estimateSize: (i) => columns[i],
overscan: 5,
lanes: 4,
})
...
}
Beta Was this translation helpful? Give feedback.
All reactions