vsdvs

Free-up Main-UI Thread in React Native for building a Smooth UI using react-native-bg-thread

Sidhartha Mallick
1 min readJun 29, 2021

Time-consuming javascript code is shifted to a native background thread by freeing the main-UI thread, which helps in increasing the efficiency of the application.

Install react-native-bg-thread using the following command:

npm install react-native-bg-thread

There are some basic examples from the official docs:

Find the Github Gists attached below.

How I used it to enhance my application ?

I was using tfjs-react-native and Posenet in it. As it is not a light model, it requires heavy time-consuming calculations/operations. So, I pushed the model operations into the background thread freeing up my UI thread, hence, enhancing the UI operations going on in the front-end of the application.

I also would like to know how this helped you, do comment in the comments section and give me a thumbs up.

Connect to me at: mallicksidhartha7@gmail.com | LinkedIn | Github

! Happy Coding !😋😌

--

--

Sidhartha Mallick
Sidhartha Mallick

Written by Sidhartha Mallick

building investorsync.in/, iOS@Gojek, Ex- Intern@BrowserStack

No responses yet