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.
Try Proton Native. It uses the React Native syntax for building desktop applications without Electron.
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] (https://github.com/Microsoft/react-native-windows) the others have been deprecated or straight up abandoned.
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