React Native iOS 和 Android 文件夹不存在 [英] React Native iOS and Android folders not present

查看:66
本文介绍了React Native iOS 和 Android 文件夹不存在的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是本机反应的新手,我在理解应用程序的文件夹结构时遇到了一些麻烦,该结构应该在创建时出现在项目文件夹中.基本上,当使用 npm 创建项目时,我会得到一些起始文件(App.js 等)和一个 node_modules 文件夹.我已经启动并运行了 expo,它也创建了 .expo 文件夹.

I'm new to react native, and I've been having some trouble understanding the folder structure of the app which should supposedly be present in the project folder on creation. Basically, when creating the project with npm, I get some starting files (App.js etc.) and a node_modules folder. I've got it up and running with expo, which created the .expo folder as well.

但是,当我查看 react 的官方文档或查看 git 上的插件/插件时,他们多次谈到项目根目录中的 android 和 iOS 文件夹.但他们无处可见.然后我得到了一些提示,我可以安装和运行 react-native-upgrade-git,据称这会生成这些丢失的文件夹.但这也不起作用.

However, when I go to react's official documentation or look into plugins/addons on git they talk several times about an android and an iOS folder in the project root. But they are nowhere to be seen. I then got some hints that I could install and run react-native-upgrade-git, which allegedly would generate these missing folders. But that didn't work either.

那我错过了什么?这些文件夹在哪里?

So what have I missed? Where are those folders located?

这是一个来自 Youtube 教程的屏幕转储,显示了我正在寻找的项目结构:

Here is a screen dump from a Youtube tutorial showing the project structure I'm looking for:

推荐答案

Expo 在 React Native 之上的一个要点是,您无需深入研究 android 或 ios 代码.Expo 会为您处理这些文件夹,您无需与它们进行交互.你有什么需要这些文件夹的原因吗?如果是这样,你将不得不弹出.这是这样做的文档:Ejecting with ExpoKit

One of the points of Expo on top of React Native is that you don't go down to android or ios code. Expo deals with those folders for you, you don't need to interact with them. Is there a reason you need those folders? if so, you will have to eject. Here's the documentation to do so: Ejecting with ExpoKit

这篇关于React Native iOS 和 Android 文件夹不存在的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆