Can you use React Native to create a desktop application?
Asked Answered
C

9

70

I'm making a desktop application with create-react-app and Electron. It needs to run on Mac, Windows and Linux. I also want to make a native version afterwards for Android and iOS.

Can I just make an application in React Native that works on mobile devices and on desktops? It would maybe save a lot of time.

Crevasse answered 8/1, 2018 at 14:8 Comment(0)
N
47

Try Proton Native. It uses the React Native syntax for building desktop applications without Electron.

Naive answered 23/2, 2018 at 2:28 Comment(1)
Sadly, both Proton Native and it's main fork, Valence Native, seem to have been abandoned in 2021.Excerpt
I
28

There isn't any official support for desktop applications in React Native, at least as of January 2018.

There are, however, various experimental forks of React Native for desktop platforms such as react-native-windows for Univeral Windows Platform, react-native-macos for Mac and react-native-desktop for Linux. They're not developed by the main RN team, though, so your milage may vary.

As of July 2021 it unfortunately looks like the only project still being actively being maintained is react-native-windows. The others have been deprecated or straight up abandoned.

Impanel answered 8/1, 2018 at 14:26 Comment(4)
That sounds like I would have to make 3 apps??? Maybe I shall stick with electron.Crevasse
@riscos3: You wouldn't be the first to use Electron for desktop and React Native for mobile, if you choose that route - that's exactly what Discord did, and it seems to have turned out okay for them.Impanel
@joe-clay, the last implementation you mentioned (react-native-desktop) works also for mac and should work for window (but not tested yet). But it is in development now and doesn't cover all functionality of React Native.Neuropathy
Hi, some changes since Jan 2018 ?Sparerib
T
14

Seems like quit a bit has changed in two years since this post was made. I wanted to give an update.

Currently, these projects going on...

React Native Windows - React Native support for Microsoft's Universal Windows Platform (UWP) and the Windows Presentation Foundation (WPF)

React Native DOM - An experimental, comprehensive port of React Native to the web. (Not to be confused with React Native Web, which has different goals)

React Native Turbolinks - React Native adapter for building hybrid apps with Turbolinks 5.

React Native Desktop - A project aiming to bring React Native to the Desktop with Qt's QML. A fork of React Native Ubuntu, which is no longer maintained.

React Native macOS - An experimental React Native fork targeting macOS and Cocoa

React Native tvOS - adaptation of React Native for Apple tvOS alita - An experimental, comprehensive port of React Native to mini-program(微信小程序).

Proton Native - A wrapper for React Native, using Qt to target Linux, MacOS, and Windows.

All of this directly from the React Native website: https://reactnative.dev/docs/out-of-tree-platforms#docsNav

Tillery answered 2/10, 2020 at 16:11 Comment(1)
How about Linux?Nazario
T
10

Microsoft announced a library for targeting Windows desktop, Xbox, and Windows tablets last week. And the Tech Crunch article on it also links out to an experimental Mac library.

Microsoft launches React Native for Windows

There's also a Qt based library... React Native Desktop

I wouldn't say desktop support is mature, but it's growing.

Tarver answered 13/5, 2019 at 17:8 Comment(0)
C
6

Recently I came across this project. Check it out:

React NodeGUI

I have not used it, but it looks promising and serves to make desktop applications with React.

Can I just make an application in React Native that works on mobile devices and on desktops? It would maybe save a lot of time.

By the way, if you are looking to create a performant cross-platform application for mobile, desktop, and web from a single codebase, maybe you should try Flutter.

It seems like Proton Native has added support for styling and layouts. You should check that project too. I used it some time ago when it was based on libui, but now is based on its own binding of Qt.

Collen answered 4/10, 2019 at 8:31 Comment(0)
B
5

On Windows the Microsoft team officially added the support of React Native to Windows.

The MacOS part seems to be still a work in progress, but you can find a fork of Facebook/React Native here: https://github.com/microsoft/react-native

Bramlett answered 28/4, 2020 at 21:39 Comment(0)
B
3

Now Microsoft is fully investing in React Native for Windows which allows you to build applications for all devices supported by Windows 10, including PCs, tablets, 2-in-1 PCs, Xbox, mixed reality devices, etc.

Microsoft React Native also has support for macOS.

React Native for Windows

Biome answered 24/5, 2020 at 16:1 Comment(0)
S
2

I am once again jumping in here with an update that will hopefully stay ever-green. Check out Out-of-Tree Platforms from the React Native documentation for a brief list on what they recommend.


As of Jun 2022, it looks like this:

Out-of-Tree Platforms

React Native is not only for Android and iOS devices - our partners and the community maintain projects that bring React Native to other platforms, such as:

From Partners

  • React Native macOS - React Native for macOS and Cocoa.
  • React Native Windows - React Native for Microsoft's Universal Windows Platform (UWP).

From Community

  • alita - An experimental, comprehensive port of React Native to mini-program (微信小程序).
  • React Native tvOS - React Native for Apple TV and Android TV devices.
  • React Native Web - React Native on the web using React DOM.
  • Valence Native - A wrapper for React Native, using Qt to target Linux, macOS, and Windows. Forked from Proton Native which is no longer maintained.
Swashbuckling answered 28/6, 2022 at 0:30 Comment(1)
how much code can you share and how performant they run on especially on the web? or you have to build a React app for web for better performance?Hartford
R
2

As of September 2023, Microsoft has brought React Native for Windows + macOS.

The following link has the get started for both platforms. https://microsoft.github.io/react-native-windows/

Rossen answered 28/9, 2023 at 13:24 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.