Fork me on GitHub

Anyone out there experiencing UI jank due to computations that are occurring on the main thread? I couldn’t take it anymore, so I moved everything over to a worker thread and I’m quite pleased with the result. I’m sharing my code as a library in case anyone else finds it useful. The library is using re-frame and react-native-workers. Let me know what you think!


@seantempesta: Can you elaborate more about the problem? I thought ReactNative itself does everything on background thread


Native things render on the background thread. Navigation, animations, and list views are some of the things I’ve had problems with.


(those aren’t native and run in the javascript thread)


I started running into this problem on some of my views that had a lot of aggregate calculations. One change to the underlying data set and most things needed to be recalculated. Having the UI freeze every time that happens isn’t such a great UI experience.


I make some animated gifs that show it happening. You can also just run the example to see it for yourself.


ah, got it - you have heavy computation and it affects the UI. I’ll check the code, thank you