从React到React Native

In my experience, going from native Android development to React Native has simply been a pleasure. Although there is generally less flexibility, development is much faster and cleaner in my opinion, and I just love it. So without further ado, let’s get started.

以我的经验,从原生Android开发转到React Native只是一种乐趣。 尽管通常灵活性较差,但我认为开发会更快,更清洁,我就是喜欢它。 因此,事不宜迟,让我们开始吧。

什么是React Native? (What Is React Native?)

React Native is a library that works with the React library to render out native components to an iOS or Android device. Therefore, you will need some knowledge of React to dive into React Native.

React Native是一个与React库一起使用的库,用于将本机组件渲染到iOS或Android设备。 因此,您将需要一些有关React的知识才能深入到React Native。

为什么要使用Native? (Why React Native?)

The biggest advantage lies in cross-platform development. With React Native, you have a single codebase that can be built for both iOS and Android devices. For most companies, this saves a lot of time and money, as native mobile development requires two different codebases and two different teams — native iOS development being done in Swift and native Android development being done in Java/Kotlin. Especially if you’re a developer who knows JavaScript but not Swift, Java, or Kotlin, it makes sense to simply use React Native to develop a mobile app because of faster shipping time (i.e. the time saved from learning a new language and development environment).

最大的优势在于跨平台开发。 使用React Native,您可以为iOS和Android设备构建单个代码库。 对于大多数公司而言,这节省了很多时间和金钱,因为本机移动开发需要两个不同的代码库和两个不同的团队-本机iOS开发在Swift中完成,本机Android开发在Java / Kotlin中完成。 尤其是如果您是一位懂JavaScript却不懂Swift,Java或Kotlin的开发人员,则由于发货时间更快(即从学习新语言和开发环境而节省的时间),仅使用React Native来开发移动应用程序是有意义的)。

Another emerging framework for cross-platform development is Flutter, an open-source UI toolkit created by Google. The only disadvantages that I know of are that it uses the Dart language (so you’ll need to spend time learning it) and it’s relatively new, so there may be not as much community support. However, I can see Flutter as the new mainstream way of cross-platform development in the future, so I think it’s definitely worth learning if you have the time. But for now, React Native is still the king of this cross-platform business.

跨平台开发的另一个新兴框架是Flutter ,这是由Google创建的开源UI工具包。 我知道的唯一缺点是它使用Dart语言(因此您需要花一些时间来学习它)并且它相对较新,因此可能没有太多的社区支持。 但是,我可以将Flutter视为未来跨平台开发的新主流方式,因此,我认为如果有时间,绝对值得学习。 但就目前而言,React Native仍然是该跨平台业务的王者。

组件 (Components)

React Native provides you with built-in components and APIs that you can use to render views on mobile devices. These components are used exactly the same way as you would use them in normal React web app development.

React Native为您提供了内置组件和API,

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值