RN项目环境搭建

本文档详细介绍如何搭建React Native项目环境,包括必要的软件安装如Node.js、Watchman等,并介绍了如何使用react-navigation进行页面导航配置,同时提供了地图插件的安装指南。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

##RN项目环境搭建
参考网址:https://facebook.github.io/react-native/docs/getting-started.html
###搭建步骤
一、安装
npm install brew
brew install node
brew install watchman
yarn add react-native-cli
react-native init 项目名称
cd 项目名称

-------- react-navigation参考地址 https://reactnavigation.org/docs/zh-Hans/getting-started.html

yarn add react-navigation
yarn add react-native-gesture-handler
react-native link react-native-gesture-handler
yarn add react-native-vector-icons
react-native link react-native-vector-icons

-------- react-navigation参考地址 -------

yarn add @ant-design/react-native

—安装地图插件

参考地址https://js.coach/react-native-amap3d?search=react-native-amap3d
1、npm i react-native-amap3d

2、你需要使用 CocoaPods,在 ios 目录下新建文件 Podfile:

  • 参考地址https://facebook.github.io/react-native/docs/integration-with-existing-apps#configuring-cocoapods-dependencies
    1》cd ios
    2》$ brew install cocoapods
    3》$ pod init
    4》修改Podfile文件内容改为(这部一次不能一次成功,需要多次尝试)
    image.png
    参考代码

image.png

3、pod install

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值