Skip to content

Conversation

moonrailgun
Copy link

@moonrailgun moonrailgun commented Feb 16, 2023

In AutoSizer

The height pass to children will be 0 at first, and later to real height. and in List, if height === 0, useVirtual will be false. And virtual effect will invalid and all list item will be render.

In your souce code, i think you did wanna to check whether height is a valid number, skip virtual if height not set and not a number. so i think a strict check is better than implicit type conversion.

In [AutoSizer](https://github.com/bvaughn/react-virtualized/blob/master/source/AutoSizer/AutoSizer.js)

The height pass to children will must be 0, and next to real height.
and in List, if `height === 0`, `useVirtual` will be `false`. And virtual effect will invalid and all list item will be render.

In your souce code, i think you did wanna to check whether height is a valid number, skip virtual if height not set and not a number.
so i think a strict check is better than implicit type conversion.
@vercel
Copy link

vercel bot commented Feb 16, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated
virtual-list ❌ Failed (Inspect) Feb 16, 2023 at 6:54AM (UTC)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant