P
P
pcdesign2019-05-19 09:03:23
React Native
pcdesign, 2019-05-19 09:03:23

What to do with the warning: "VirtualizedList: You have a large list that is slow to update"?

There is a heavy json file that is loaded into FlatList.
And periodically this message appears:

VirtualizedList: You have a large list that is slow to update - make sure your renderItem function renders components that follow React performance best practices like PureComponent, shouldComponentUpdate, etc. Object {
  "contentLength": 5758.33349609375,
  "dt": 826,
  "prevDt": 729,
}

I tried googling but couldn't find what exactly to do.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Roman Alexandrovich, 2019-05-19
@RomReed

this is just a warning that your list is rendering for a long time and it is suggested to look for an opportunity to optimize it, for example, rewrite renderItem with PureComponent or write shouldComponentUpdate

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question