WhoBuilt

Building For Desktops And Dual Screens

Oct 21, 2020· 19 min· 791 views·Watch on YouTube

Speaker

Steven Moyes, a program manager on Microsoft’s React Native team, explains how React Native can support desktop apps on Windows and macOS and dual-screen apps such as those for Surface Duo at React Native EU 2020, hosted by Callstack.

React Native expands to desktop

Moyes says Microsoft is extending React Native’s shared core to Windows and macOS, alongside its existing Android and iOS support. He highlights Messenger’s native video-calling app and the Xbox beta app as examples of teams using React Native for desktop.

Performance and getting started

Moyes reports that the Xbox team reduced memory use from 1.6 GB to 350 MB and CPU spikes from 50% to 30% after moving from Electron. More than 95% of surveyed users said performance was the same or better. He demonstrates creating a macOS app with the React Native CLI and the `react-native-macos-init` command.

Modules and Fluent UI

Moyes points developers to React Native Directory, which includes filters for Windows and macOS modules, while noting desktop support for existing modules is still a work in progress. Native modules may need platform-specific implementations; Windows implementations can use C# or C++. Fluent UI React Native adds customizable, theme-aware components with accessibility support and platform-native fonts.

Building for dual screens

Moyes describes Microsoft’s dual-screen APIs for Android devices such as Surface Duo. TwoPaneView lays out content in two panes, while DualScreenInfo reports whether an app spans both screens and provides device orientation information. In the RSS app demo, the feed list and web view appear in separate panes when the app spans both screens.

Resources and community

Moyes directs developers to a Build 2020 video about the RSS reader app and to aka.ms/reactnative for setup guides, API and module documentation, and Fluent UI information. He also recommends contacting the Microsoft React Native team on Twitter at @ReactNativeMSFT or through GitHub.

Takeaways

  • React Native desktop support can extend an app’s reach to Windows and macOS while building on its shared core.
  • Measure resource use and user experience when evaluating a move from Electron; the Xbox team reported lower memory use and CPU spikes.
  • Check React Native Directory for desktop-compatible modules, and plan for native platform work where needed.
  • Use TwoPaneView and DualScreenInfo to adapt Android app layouts and behavior for dual-screen devices.
  • Start with the official Windows and macOS guides, then verify which modules and UI components fit the target platforms.

Mentioned in this talk

Search inside this talk

What was claimed 12

Related talks