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

Add a check for scrollEnabled to VirtualizedList error #34560

Closed

Conversation

annepham25
Copy link

Summary

Nested VirtualizedList is now an error, instead of a warning. Issues here and here outline the concern.

Changelog

[General] [Added] - Added a check to if scrollEnabled is not false, if so then fire the VirtualizedList error

Test Plan

Passes all provided automatic tests. In a personal app, there is a situation of nested ScrollViews that had triggered the error. After defining scrollEnabled={false} and adding the check, the error no longer appears.

@facebook-github-bot
Copy link
Contributor

Hi @annepham25!

Thank you for your pull request and welcome to our community.

Action Required

In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at cla@fb.com. Thanks!

@react-native-bot react-native-bot added the Type: Enhancement A new feature or enhancement of an existing feature. label Sep 1, 2022
@facebook-github-bot
Copy link
Contributor

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks!

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Sep 1, 2022
@facebook-github-bot
Copy link
Contributor

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks!

@facebook-github-bot facebook-github-bot added the Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team. label Sep 1, 2022
@NickGerleman
Copy link
Contributor

Could you help me understand why the error condition doesn't apply when scrollEnabled is set to false?

@NickGerleman
Copy link
Contributor

VirtualizedList is also split between two components at the moment for staging, so any changes to it should also be made to VirtualizedList_EXPERIMENTAL

@facebook-github-bot
Copy link
Contributor

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks!

@annepham25
Copy link
Author

annepham25 commented Sep 6, 2022

@NickGerleman
My understanding is that I believe the error's concern is about breaking "windowing", but the list virtualization isn't needed when scrollEnabled is set to false so there wouldn't be anything to break.

@analysis-bot
Copy link

Platform Engine Arch Size (bytes) Diff
android hermes arm64-v8a 7,617,289 -19,746
android hermes armeabi-v7a 7,031,500 -17,734
android hermes x86 7,917,480 -21,358
android hermes x86_64 7,891,141 -19,630
android jsc arm64-v8a 9,494,870 -17,959
android jsc armeabi-v7a 8,272,579 -15,755
android jsc x86 9,432,763 -19,452
android jsc x86_64 10,025,808 -17,555

Base commit: 00458c9
Branch: main

@analysis-bot
Copy link

Platform Engine Arch Size (bytes) Diff
ios - universal n/a --

Base commit: 37d0a25
Branch: main

@facebook-github-bot
Copy link
Contributor

@NickGerleman has imported this pull request. If you are a Meta employee, you can view this diff on Phabricator.

@react-native-bot
Copy link
Collaborator

This pull request was successfully merged by Anne Pham in 62f83a9.

When will my fix make it into a release? | Upcoming Releases

@react-native-bot react-native-bot added the Merged This PR has been merged. label Sep 8, 2022
@annepham25
Copy link
Author

I realized that the change was removed from VirtualizedList.js, so it's only in VirtualizedList_EXPERIMENTAL.js instead of both. I pushed a new change.

OlimpiaZurek pushed a commit to OlimpiaZurek/react-native that referenced this pull request May 22, 2023
Summary:
Nested `VirtualizedList` is now an [error](facebook@646605b), instead of a warning. Issues [here](facebook#31697) and [here](facebook#33024) outline the concern.

## Changelog

[General] [Added] - Added a check to if `scrollEnabled` is not false, if so then fire the `VirtualizedList` error

Pull Request resolved: facebook#34560

Test Plan: Passes all provided automatic tests. In a personal app, there is a situation of nested ScrollViews that had triggered the error. After defining `scrollEnabled={false}` and adding the check, the error no longer appears.

Reviewed By: yungsters

Differential Revision: D39283866

Pulled By: NickGerleman

fbshipit-source-id: 16ae6bbe6bb8b01a54ae18f9e6abf75d11c21c29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Merged This PR has been merged. Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team. Type: Enhancement A new feature or enhancement of an existing feature.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants