Sitemap
JavaScript in Plain English

New JavaScript and Web Development content every day. Follow to join our 3.5M+ monthly readers.

Follow publication

Member-only story

How to Fix ‘VirtualizedLists should never be nested inside plain ScrollViews’ Warning

3 min readFeb 20, 2020

--

Photo from Unsplash

If you are using React Native to develop your app and you nest a FlatList or SectionList component inside a plain ScrollView, you might encounter the following warning in your debugger:

VirtualizedLists should never be nested inside plain ScrollViews with the same orientation - use another VirtualizedList-backed container instead.

While this warning makes it clear that the current configuration is not ideal, it does not explain why it is problematic or how to fix the issue. In this article, we will explore the reasons behind this warning and provide solutions for fixing it.

Virtualized lists, such as SectionList and FlatList, are designed to optimize performance and reduce memory consumption when rendering large lists of content. These lists only render the content that is currently visible on the screen, and replace the rest of the list items with blank space. As the user scrolls, the list updates and renders new items based on the scrolling position. This approach allows for smoother, faster rendering of large lists without consuming excessive resources.

--

--

JavaScript in Plain English
JavaScript in Plain English

Published in JavaScript in Plain English

New JavaScript and Web Development content every day. Follow to join our 3.5M+ monthly readers.

Perttu Lähteenlahti
Perttu Lähteenlahti

Written by Perttu Lähteenlahti

😺 Senior Developer Advocate at RevenueCat

Write a response