简体   繁体   English

react-native vs reactXP

[英]react-native vs reactXP

I have started developing an application for all the three platforms (web, ios and android) with single code base.我已经开始使用单一代码库为所有三个平台(web、ios 和 android)开发应用程序。

I came across these two libraries and I want to know which one is better and why?我遇到了这两个库,我想知道哪个更好,为什么?

Also, I came across a lot of open source react-native projects, For example React Navigation , Lottie .另外,我遇​​到了很多开源的 react-native 项目,例如React NavigationLottie

Can I integrate react-navigation (or any popular react-native module) in my react-native-web or reactXP application?我可以在我的 react-native-web 或 reactXP 应用程序中集成 react-navigation(或任何流行的 react-native 模块)吗?

Please provide your inputs and TIA.请提供您的意见和 TIA。

react-native is a framework for building iOS and Android applications using React. react-native是一个使用 React 构建 iOS 和 Android 应用程序的框架。 You can read more about the React Native bridge concept here您可以在此处阅读有关 React Native 桥接概念的更多信息

ReactXP - is a set of components/API which built on top of React Native , React , React Native Windows to simplify building cross-platform applications for multiple platforms (iOs, Android, UWP, Web) with one API for all of them. ReactXP - 是一组构建在React NativeReactReact Native Windows之上的组件/API,用于简化为多个平台(iO、Android、UWP、Web)构建跨平台应用程序,并为所有平台提供一个 API。 It is like jQuery which tries to solve the problem with cross-browser compatibility issues.它就像 jQuery 试图解决跨浏览器兼容性问题。 The similar we can say about ReactXP - it tries to provide API/Components which works on several platforms.我们可以说 ReactXP 类似——它试图提供可在多个平台上运行的 API/组件。

Can I integrate react-navigation (or any popular react-native module) in my react-native-web or reactXP application?我可以在我的 react-native-web 或 reactXP 应用程序中集成 react-navigation(或任何流行的 react-native 模块)吗?

ReactXP: It is possible, however, it is not recommended. ReactXP:有可能,但不推荐。 Usually, react-native plugins support only iOS and Android (there are exceptions and some of them support Windows ) , so, you need to care about implementation for other platforms.通常,react-native 插件仅支持iOSAndroid (也有例外,其中一些支持Windows ,因此,您需要关心其他平台的实现。 ReactXP has several extensions , including navigation . ReactXP有几个扩展,包括导航

We use RXP as much as possible, and then create a different set of components for the web vs mobile.我们尽可能地使用 RXP,然后为 Web 和移动创建一组不同的组件。

For example on the web, you most likely want an <a> tag with a href prop to support opening links in new tabs.例如在 Web 上,您很可能需要带有href属性的<a>标签来支持在新标签页中打开链接。 And on mobile you obviously don't.而在移动设备上,您显然不会。 In this case we have implemented the <Link> component for each platform.在本例中,我们为每个平台实现了<Link>组件。

Same goes for navigation, modals, selects, etc.., and other platform specific things like localstorage implementation.同样适用于导航、模式、选择等,以及其他平台特定的东西,如本地存储实现。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM