Quantcast
Channel: Active questions tagged react-native+typescript - Stack Overflow
Viewing all articles
Browse latest Browse all 6214

How to perform heavy task in react native?

$
0
0

Getting some data from a hardware device via bluetooth in every 10 milliseconds. Performing some heavy task like merging data, parsing, building list and setting into state to show data into table and graph.

The issue is UI is freezing while receiving data from bluetooth. Not able to perform touch in UI but data is rendering in UI.

BluetoothService.getInstance().monitorRecord((record: Record) => {// This is a callback calling in every 10 milliseconds            //setting record into state, setting record into state is taking 100+ milliseconds            setRecord(record);            // Preparing suitable data fro graph this is taking 2 milliseconds            prepareDataFroGraph(record);            //building list of record this will taking 2 milliseconds            recordData(record);        }, TransactionId.MONITOR_RECORD)

Viewing all articles
Browse latest Browse all 6214

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>