React Native outlines its many platform vision for desktop and VR
The React Native team has published a post describing its "many platform" vision: extending React Native beyond mobile apps to desktop and virtual reality, while building to each platform's strengths and constraints.
Respecting the platform
The first guiding principle is matching what users expect on each platform. On Android, for example, apps should be accessible with TalkBack, navigation should behave like other Android apps, and buttons should look and feel like Android buttons rather than iOS ones. The team says it aims for a consistent cross-platform developer experience without sacrificing those user expectations.
Embracing platform constraints
Different devices bring different limits. Memory is typically tighter on Android and VR headsets than on iOS, macOS and Windows, and users expect mobile apps to start faster than desktop apps. The post gives the example of "view flattening", an optimization originally built in Java to reduce memory usage on Android. When it was reimplemented in C++ for the new cross-platform renderer, trying it on iOS became a matter of flipping a switch, and it improved performance in the production Facebook app on iOS.
Institutional knowledge and competition
The team says targeting more platforms brings together engineers with different expertise. React Native's accessibility abstractions draw on how Android, iOS and web handle accessibility, and concurrent features such as Suspense, vetted on the new Facebook.com website, are now coming to React Native through the new renderer. The post notes that React frequently draws inspiration from web frameworks like Vue, Preact and Svelte, and notes that demand for faster iteration on the web led to Fast Refresh.
Expanding to new platforms
According to the post, React has started the road to a React 18 release, and the new React Native renderer now fully powers the Facebook mobile apps.
- Desktop: For the past year, the team has partnered with Microsoft and the Messenger team on native video calling for Windows and macOS. The React Native implementation outperformed the Electron implementation it replaced. The desktop collaboration work is taking place on GitHub.
- VR: The team is partnering more closely with Facebook Reality Labs to understand how React can deliver virtual reality experiences on Oculus. Most VR development will remain internal for now, with technology validated at Facebook scale before anything is shared publicly. The team anticipates that VR-related improvements, such as memory reductions, will surface in open source and benefit mobile and desktop.
The post also recalls earlier examples of React on more platforms, including Netflix's Gibbon renderer for TV and Microsoft's use of React for native desktop experiences in Office and Windows 10.
Links
Source: reactnative.dev