简体   繁体   中英

React native SetState array every half second Make App hang with large data

I am working on Trading application using React Native where data needs to get update every 0.5 second interval.

I am using setState to update the latest array in parent component and passing values in child component to bind list values.

It makes app hang while array item become more than 100 items while make SetState in comment working fine but no update values in DOM.

Can I use ForceUpdate to Update values in DOM or any Other solution please?

在此处输入图像描述

在此处输入图像描述

在此处输入图像描述

在此处输入图像描述

use flatList for mapping large list

Flatlist is cool because it does the rendering for you and renders the items as they are needed on the screen instead of all at once which is the case of the ScrollView. You provide the FlatList an array of data and what the items should look like and it runs it through it's own mapping function.

here is link to documentation

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM