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 crash if estimatedItemSize is NaN #832

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

Conversation

ritmillio
Copy link

Description

Fixes (issue #)
This PR fixes a crash caused by the estimatedItemSize having a NaN value in some cases. (I came across with the problem when I was developing a Carousel component where I was calculating the estimatedItemSize inside of a useCallback.) The application now checks for NaN values and sets estimatedItemSize to null, which prevents the crash. However, this may cause performance issues, so a warning message is displayed in the console to alert developers about the potential problem.

Screenshots or videos (if needed)

Checklist

  • Check if the implemented solution prevents crashes caused by NaN estimatedItemSize values.
  • Check if the implemented solution prevents crashes caused by NaN estimatedItemSize values.

Fixed

-estimatedItemSize is NaN check

@ritmillio
Copy link
Author

I have signed the CLA!

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