Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can you use React Native to create a desktop application?

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.

like image 827
riscos3 Avatar asked Jan 08 '18 14:01

riscos3


People also ask

Is react used for desktop applications?

Because today, You can use React Node GUI to build a React-based desktop app! Just like Electron, Node GUI is a framework that you can use to build a desktop app with JavaScript.

How do I make a native desktop app?

To create a Windows desktop project in Visual Studio From the main menu, choose File > New > Project to open the Create a New Project dialog box. At the top of the dialog, set Language to C++, set Platform to Windows, and set Project type to Desktop.

Is React Native for Windows Good?

The react-native-windows project indeed renders platform-specific UI elements from a JavaScript-based codebase. Therefore, if you are looking for a way to build high-quality Windows desktop apps with React Native, it is the best solution out there.


7 Answers

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

like image 105
Finesse Avatar answered Oct 05 '22 21:10

Finesse


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.

like image 38
Joe Clay Avatar answered Oct 05 '22 23:10

Joe Clay


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

like image 25
David Vernon Avatar answered Oct 05 '22 22:10

David Vernon


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.

like image 38
LetMyPeopleCode Avatar answered Oct 05 '22 22:10

LetMyPeopleCode


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.

like image 27
Noxware Avatar answered Oct 05 '22 23:10

Noxware


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

like image 42
fannolo Avatar answered Oct 05 '22 22:10

fannolo


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

like image 38
TheEhsanSarshar Avatar answered Oct 05 '22 23:10

TheEhsanSarshar