reactjs 你能用 react native 创建桌面应用吗
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/48152008/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Can you use react native to create a desktop app
提问by riscos3
I'm making a desktop app with create-react-app and electron. It needs to run on mac, windows and linux, I also want to make a native version after for android and ios.
我正在使用 create-react-app 和电子制作桌面应用程序。它需要在 mac、windows 和 linux 上运行,我也想为 android 和 ios 制作一个原生版本。
Can I just make an app in react-native that works on mobile devices and on desktops? It would maybe save a lot of time
我可以制作一个适用于移动设备和台式机的 react-native 应用程序吗?它可能会节省很多时间
回答by Finesse
Try Proton Native. It uses the React Native syntax for building desktop applications without Electron.
试试质子原生。它使用 React Native 语法来构建没有 Electron 的桌面应用程序。
回答by Joe Clay
There isn't any official support for desktop applications in React Native, at least as of January 2018.
至少截至 2018 年 1 月,React Native 中没有对桌面应用程序的任何官方支持。
There are, however, various experimental forks of React Native for desktop platforms such as react-native-windowsfor Univeral Windows Platform, react-native-macosfor Mac and react-native-desktopfor Linux. They're not developed by the main RN team, though, so your milage may vary.
然而,有各种用于桌面平台的 React Native 的实验性分支,例如用于通用 Windows 平台的react-native-windows、用于 Mac 的react-native-macos和用于 Linux 的react-native-desktop。但是,它们不是由主要 RN 团队开发的,因此您的进展可能会有所不同。
回答by YiddishNinja
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.
微软上周宣布了一个面向 Windows 桌面、XBox 和 Windows 平板电脑的库。关于它的 Tech Crunch 文章也链接到一个实验性的 Mac 库。
https://techcrunch.com/2019/05/06/microsoft-launches-react-native-for-windows/
https://techcrunch.com/2019/05/06/microsoft-launches-react-native-for-windows/
There's also a QT based library... https://github.com/status-im/react-native-desktop
还有一个基于 QT 的库... https://github.com/status-im/react-native-desktop
Wouldn't say desktop support is mature, but it's growing.
不会说桌面支持已经成熟,但它正在增长。
回答by Noxware
Recently I came across this project, check it out:
最近我遇到了这个项目,看看:
I have not used it but it looks promising and serves to make desktop applications with React.
我没有使用过它,但它看起来很有前途,并且可以用 React 制作桌面应用程序。
Can I just make an app in react-native that works on mobile devices and on desktops? It would maybe save a lot of time
我可以制作一个适用于移动设备和台式机的 react-native 应用程序吗?它可能会节省很多时间
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.
顺便说一句,如果您希望从单个代码库为移动、桌面和 Web 创建一个高性能的跨平台应用程序,也许您应该尝试 Flutter。
EDIT:It seems like Proton Nativehas 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 it's own binding of Qt.
编辑:似乎Proton Native增加了对样式和布局的支持。你也应该检查那个项目。前段时间我用过它,当时它是基于 libui 但现在是基于它自己的 Qt 绑定。
回答by fannolo
On react native for windows the Microsoft team officially added the support of RN to Windows (https://microsoft.github.io/react-native-windows/)
在 React Native for Windows 上,微软团队正式将 RN 的支持添加到 Windows ( https://microsoft.github.io/react-native-windows/)
MacOS seems to be still a WIP, but you can find a fork of facebook/react-native here: https://github.com/microsoft/react-native
MacOS 似乎仍然是一个 WIP,但你可以在这里找到 facebook/react-native 的一个分支:https: //github.com/microsoft/react-native
回答by Ehsan sarshar
now Microsoft is fully investing in react native windows which allows you to build apps for all devices supported by Windows 10 including PCs, tablets, 2-in-1s, Xbox, Mixed reality devices etc. and also Microsoft react native have also support for Mac os
现在微软正在全力投资 react native windows,它允许你为 Windows 10 支持的所有设备构建应用程序,包括 PC、平板电脑、二合一、Xbox、混合现实设备等,而且微软 react native 也支持 Mac操作系统
https://github.com/microsoft/react-native-windows/blob/master/README.md
https://github.com/microsoft/react-native-windows/blob/master/README.md

