React Native Blog Mar 13, 2017

Better List Views

Article Summary

React Native just killed ListView. The new list components solve memory leaks, stale rows, and ignored bugs that plagued mobile developers for years.

React Native's March 2017 release (0.43-rc.1) introduced a complete overhaul of list rendering with FlatList, SectionList, and VirtualizedList. These components replace the problematic ListView and DataSource APIs with simpler, more performant alternatives built for production apps.

Key Takeaways

Critical Insight

The new list components deliver constant memory performance and simpler APIs, but require external state management since unmounted items lose internal state.

The scheduling improvements and render window optimizations reveal how React Native is rethinking mobile performance at the platform level.

About This Article

Problem

React Native developers ran into a problem: whenever any props changed, all items in the render window would re-render. This created performance issues, especially for complex item components that didn't have proper optimization.

Solution

React Native's engineering team suggested using React best practices. Developers should implement React.PureComponent and shouldComponentUpdate in their item components to prevent unnecessary re-renders in the subtree and keep performance steady.

Impact

With the getItemLayout prop, developers can calculate row heights without actually rendering them. This makes scrollToIndex navigation smooth and improves scroll indicator accuracy without the rendering overhead.