Skip to content

Commit a124503

Browse files
Anne PhamOlimpiaZurek
Anne Pham
authored andcommitted
Add a check for scrollEnabled to VirtualizedList error (facebook#34560)
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
1 parent de39cb5 commit a124503

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Libraries/Lists/VirtualizedList_EXPERIMENTAL.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1101,7 +1101,8 @@ class VirtualizedList extends StateSafePureComponent<Props, State> {
11011101
!scrollContext.horizontal ===
11021102
!horizontalOrDefault(this.props.horizontal) &&
11031103
!this._hasWarned.nesting &&
1104-
this.context == null
1104+
this.context == null &&
1105+
this.props.scrollEnabled !== false
11051106
) {
11061107
// TODO (T46547044): use React.warn once 16.9 is sync'd: https://github.com/facebook/react/pull/15170
11071108
console.error(

0 commit comments

Comments
 (0)