-
Notifications
You must be signed in to change notification settings - Fork 24.4k
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
[Bug][FlatList] assigning object to viewabilityConfig prop in render method triggers error #16710
Comments
I'm guessing the objects in prop are not considered equal because they are recreated on each re-render?? Is this what's happening? |
Fixed this by setting the properties as a constant outside of the render method, but still not sure if these invariant checks should be doing equality checks by reference... |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Maybe the issue has been fixed in a recent release, or perhaps it is not affecting a lot of people. If you think this issue should definitely remain open, please let us know why. Thank you for your contributions. |
I still have this issue despite setting the viewabilityConfig as a constant outside of my class. It happens when the app is refreshing or reloading. Please fix this asap. |
Please re-open, this is still an issue. I second that it shouldn't be checked by reference. |
Is this a bug report?
Yup.
Have you read the Contributing Guidelines?
Yup.
Environment
OS: OS X El Capitan 10.11.6
Node: 7.10.0
Yarn: 0.24.6
npm: 4.2.0
Watchman: 4.9.0
Xcode: Xcode 8.2.1 Build version 8C1002
Android Studio: Not Found
Packages: (wanted => installed)
react: 16.0.0 => 16.0.0
react-native: 0.50.1 => 0.50.1
Steps to Reproduce
Use a flatlist with a
viewabilityConfig.viewAreaCoveragePercentThreshold
prop set to any value.e.g:
viewabilityConfig={{ viewAreaCoveragePercentThreshold: 50 }}
.Expected Behavior
Normal use of a
viewabilityConfig
prop on a FlatList.Actual Behavior
Use of
viewabilityConfig
throws errors caused by checks introduced in the following commit: ad733adGet Invariant violations, testing for equality, console.log spits out equal values, throws error regardless.
FlatList.js (425-428):
Reproducible Demo
Can't reproduce error on snack.
The text was updated successfully, but these errors were encountered: