Heavy computational function without blocking ui

Viewed 25

I am new to React Native. I have a function that is doing some heavy computation which takes arround 30 seconds to finish when called. This would be a horrible expirience if the user has to wait for this to finish. What would be the best practice for this?

1 Answers

if you can run it on native you can create a bridge method and run it on a background thread that resolves a promise with a result. maybe an easier option is to use react-native-background-task

Related