Warning: ListView is deprecated and will be removed in a future release

This post is about the Warning: ListView is deprecated and will be removed in a future release. If you are a React Native developer and working with a ListView then you have seen a warning coming nowadays and that is

Warning: ListView is deprecated and will be removed in a future release. See https://facebook.github.io/react-native/blog/2017/03/13/better-list-views.html for more information.

This warning is there because ListView is deprecated and as per the announcement on March 13, 2017.

We are officially announcing them today! No more ListViews or DataSources, stale rows, ignored bugs, or excessive memory consumption – with the latest React Native March 2017 release candidate (0.43-rc.1) you can pick from the new suite of components what best fits your use-case, with great perf and feature set out of the box.

According to that, you have to keep remember to use FlatList or SectionList instead of ListView as per your need.

FlatList

This is a component for simple, performant lists. Just provide an array of data and a renderItem function:

SectionList

If you want to render a set of data broken into sections, maybe with section headers. renderSectionHeader for the header renderItem for the content under the header and an array of sections.

The new list components have significant performance enhancements, the main one being nearly constant memory usage for any number of rows.

This is done by ‘virtualizing’ elements that are outside of the render window by completely unmounting them from the component hierarchy and reclaiming the JS memory from the React components, along with the native memory from the shadow tree and the UI views.

If you want to read more about the Reason, Performance, Advanced Usage and Future Work you can visit here.

How useful was this post?

Click on a star to rate us!

Average rating / 5. Vote count:

As you found this post useful...

Follow us on social media!

We are sorry that this post was not useful for you!

Let us improve this post!

0 replies

Leave a Reply

Want to join the discussion?   Feel free to contribute!

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.