Skip to content

Add a check for scrollEnabled to VirtualizedList error#34560

Closed
annepham25 wants to merge 4 commits into
react:mainfrom
annepham25:modifying-VirtualizedList-error
Closed

Add a check for scrollEnabled to VirtualizedList error#34560
annepham25 wants to merge 4 commits into
react:mainfrom
annepham25:modifying-VirtualizedList-error

Conversation

@annepham25

Copy link
Copy Markdown

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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Contributor

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

@NickGerleman

Copy link
Copy Markdown
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
Copy Markdown
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

annepham25 commented Sep 6, 2022

Copy link
Copy Markdown
Author

@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
Copy Markdown
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
Copy Markdown
Platform Engine Arch Size (bytes) Diff
ios - universal n/a --

Base commit: 37d0a25
Branch: main

@facebook-github-bot

Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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.

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