Skip to content

VirtualizedList - Please keep disableVirtualization (do not deprecate)Β #26237

Closed
@cristianoccazinsp

Description

@cristianoccazinsp

FlatList/VirtualizedList is great. However, it is still quite bugged when using complex components or nested lists. I have a case with up to 3 nested FlatList elements, and things start to become really messy. For example, visible components will randomly unmount and mount on some state changes (for some reason that's beyond me, e.g., when implementing some collapse/expand logic). I don't really blame the implementation, but really the design of having such a monster list which is also interactive/editable.

For this reason, and after hours of testing, disableVirtualization was the holy grail. Using this flag would immediately remove all flickering, white spaces, random unmounts, and so on. I know this defeats the purpose of virtualization, but the list is still very usable with disableVirtualization=true . The fact that the list still lazy loads is very useful, I would otherwise need to implement lazy loading myself.

React Native version:

System:
OS: macOS 10.14.5
CPU: (4) x64 Intel(R) Core(TM) i5-6267U CPU @ 2.90GHz
Memory: 678.54 MB / 8.00 GB
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 10.15.3 - /usr/local/bin/node
npm: 6.9.0 - /usr/local/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
SDKs:
iOS SDK:
Platforms: iOS 12.4, macOS 10.14, tvOS 12.4, watchOS 5.3
Android SDK:
API Levels: 28
Build Tools: 28.0.3
IDEs:
Android Studio: 3.4 AI-183.6156.11.34.5522156
Xcode: 10.3/10G8 - /usr/bin/xcodebuild
npmPackages:
react: 16.9.0 => 16.9.0
react-native: 0.60.5 => 0.60.5
npmGlobalPackages:
create-react-native-app: 2.0.2
react-native-cli: 2.0.1

Steps To Reproduce

FlatList is bogus with complex structures/use cases and disableVirtualization provides a good work around. Please consider keeping this variable as part of the API, or provide some way to disable component unmounting. Not even an obscenely large windowSize helps.

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugComponent: VirtualizedListStaleThere has been a lack of activity on this issue and it may be closed soon.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions