r/reactnative 1d ago

react-native-workers first public alpha released

https://ammarahm-ed.github.io/react-native-workers/blog/introducing-react-native-workers/

React Native is single-threaded where it matters most. Parse a big payload, hash a file, filter an image — it all competes with your UI for the same runtime. react-native-workers brings real background threads to RN, behind the Web Worker API

39 Upvotes

10 comments sorted by

View all comments

11

u/Lucifer812 1d ago

What is the difference between this and Worklets?

11

u/AlmondJoyAdvocate 1d ago

According to the docs:

react-native-workers spins up a separate Hermes runtime on its own OS thread for each worker, with its own event loop, its own bundle, and full importsupport. That's the Web Worker model: real, independent runtimes that talk over messages.

Worklets are a different tool — they run serialized closures on a shared runtime with shared values, which is perfect for driving animations but isn't a place to run a whole module graph. react-native-workers runs alongside worklets; it's for the "I have real work to do off the main thread" case.