Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fix useVirtual invalid in list work with autosizer #197

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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