create-react-native-app 和 exp init 之间的区别

differences between create-react-native-app and exp init

我发现create-react-native-app是基于expo的。但是使用exp-cli时,也是基于Expo的。

create-react-native-app 和 exp init 有什么区别?

这个问题的答案在 expo documentation

中有详细记录

Expo & "Create React Native App"

Create React Native App lets you build a React Native app without any build configuration. This may sound familiar to you because Expo does this as well -- when you create a project with XDE or exp you don't have to deal with Xcode or Android Studio configuration files, it just works. This guide is intended to outline some of the key differences between Expo and CRNA (create-react-native-app).

CRNA does not require you to have an Expo account

You can run create-react-native-app YourAppName and off you go. So what does not having an account mean, and what would signing up and using XDE/exp get you -- why do we require it with Expo? Having an Expo account allows you to do the following:

  • Publish your project to a permanent URL, eg:https://expo.io/@community/reactconf2017.See Publishing on Expo for more information.
  • Build binaries for app / play store distribution. To do this with CRNA without using Expo, you would need to run eject.

两者各有利弊:

React Native 应用优势:

您可以添加用 Java/Objective-C

编写的本机模块

React Native 应用劣势:

需要 Android Studio 和 XCode 到 运行 项目

展会优势:

设置项目很简单,几分钟即可完成

Expo 可以构建 .apk 和 .ipa 文件

您不需要模拟器即可 运行 您的应用程序。

世博劣势:

您无法添加本机模块。

使用 expo init 的最终应用会比使用 react native app init 更大。

我建议您阅读以下内容: https://docs.expo.io/versions/latest/introduction/why-not-expo

更新的答案:

create-react-native-app 被 expo-cli 取代。

https://docs.expo.io/workflow/glossary-of-terms/#create-react-native-app