VirtualizedList: you have a large list that is slowly updating

I am using FlatList with a lot of elements. I get the following warning from Expo XDE.

VirtualizedList: you have a large list that is slowly updating - make make sure your renderItem function displays the components that follow. such as PureComponent, shouldComponentUpdate, etc. {"dt": 13861, "prevDt": 1498372326027, "contentLength": 6624}

I used some optimization approaches to my FlatList like PureComponent, but I still get this warning. Before I describe my optimizations, could you tell me if this warning will always appear, although FlatList is optimized? Or perhaps this indicates actual performance issues? I ask because the performance of my FlatList is good.

+13
source share
2 answers

. . , console.log() render() , FlatList, , . , FlatList , ( , FlatList). PureComponents. FlatList:

<FlatList
    ref={(ref) => { this.flatListRef = ref; }}
    data={allPosts}
    initialNumToRender={7}
    renderItem={({ item }) =>
      <Post postJson={item} isGroupAdmin={isGroupAdmin} user={user} />
    }
  />

, <Post/> :

import React, { PureComponent } from 'react';
class Post extends PureComponent {

  render() { ... }
}

FlatList . renderItem , - :

return (
  <View>
  ...
  </View>
);

, FlatList , . , PureComponent, FlatList , ( ).

. initialNumToRender , ( ). , FlatList (, ).

).

,

+9

, FlatList SourceList. , native-base , Component <Content> ScrollList.

. : fooobar.com/questions/6776312/...

0

All Articles