Mozilla and Filament have released Uniffi for React Native, an open-source tool designed for building React Native Turbo Modules using Rust. This development enables millions of developers creating cross-platform React Native applications to leverage Rust, a modern programming language recognized for its safety and performance. Developers can now create single implementations of their app’s core logic that function seamlessly across iOS and Android.
This release is significant for Filament, which co-developed the library with Mozilla and lead developer James Hugman. The tool aims to benefit many other developers by offering advantages such as reduced code, improved memory safety, and enhanced performance, alongside the opportunity to utilize Rust in more development contexts.
React Native is a popular framework for cross-platform app development, yet it presents certain challenges. Its reliance on a single JavaScript thread can lead to performance bottlenecks during complex operations. Historically, developers addressed this by either duplicating code for iOS and Android or by using C++, which can be complex to manage. Uniffi for React Native provides an improved solution, allowing developers to offload demanding tasks to Rust, which can now be easily integrated with React Native. This integration leads to faster, smoother applications and a more efficient development workflow.
How Uniffi for React Native Works
Uniffi for React Native functions as a uniFFI bindings generator, enabling the use of Rust within React Native through Turbo Modules. It offers an abstraction level that allows developers to concentrate on application requirements, avoiding the intricate details of native cross-platform development. The tooling generates:
- Typescript and JSI C++ for calling Rust from Typescript and vice versa
- A Turbo-Module that integrates the bindings into a running React Native library.
The ongoing development of this project is significant. In 2020, Uniffi was introduced as a ‘write once; run anywhere’ toolset for Rust. Its evolution began as a method to achieve a single Rust implementation for Firefox Sync’s core, deployable across Android and iOS applications. Since then, Mozilla has successfully utilized uniffi-rs to integrate Rust into mobile and desktop products, reaching hundreds of millions of users. This Rust code powers critical subsystems like bookmarks and history sync, Firefox Suggest, telemetry, and experimentation. Beyond Mozilla, Uniffi is also employed in Android (in AOSP), high-profile security products, and various complex libraries within the community.
Uniffi for React Native is currently in an early release phase. While a dedicated landing page and repository examples are under development, open-source contributor Johannes Marbach, sponsored by Unomed, has already utilized Uniffi for React Native to develop a React Native Library for the Matrix SDK.
Potential applications for Uniffi for React Native include two key areas:
- Utilizing Rust to offload computationally intensive code to a multi-threaded and memory-safe subsystem, thereby mitigating single-threaded JavaScript performance bottlenecks in React Native.
- Leveraging the extensive library of Rust crates within React Native applications. For instance, a Filament developer recently demonstrated this by replacing a slow Typescript implementation with a fast blurhashing library from crates.io, achieving functional integration within a single day. The aim is to further enhance tooling to simplify such optimizations.
Uniffi marks a significant advancement in cross-platform development, merging the capabilities of Rust with the adaptability of React Native to open new avenues for application developers.

