React Native Iconic 项目教程

React Native Iconic 项目教程

react-native-iconicReact Native - Native Animated Icons with different states项目地址:https://gitcode.com/gh_mirrors/re/react-native-iconic

1、项目的目录结构及介绍

react-native-iconic/
├── android/
│   ├── app/
│   ├── build.gradle
│   ├── gradle.properties
│   ├── settings.gradle
│   └── ...
├── ios/
│   ├── ReactNativeIconic/
│   ├── ReactNativeIconic.xcodeproj/
│   ├── ReactNativeIconic.xcworkspace/
│   └── ...
├── scripts/
│   ├── build.sh
│   ├── deploy.sh
│   └── ...
├── src/
│   ├── components/
│   ├── index.js
│   └── ...
├── .gitignore
├── .prettierignore
├── LICENSE
├── README.md
├── package.json
├── tsconfig.json
└── yarn.lock

目录结构介绍

  • android/: 包含Android项目的所有文件和配置。
  • ios/: 包含iOS项目的所有文件和配置。
  • scripts/: 包含项目的构建和部署脚本。
  • src/: 包含项目的主要源代码文件,包括组件和入口文件。
  • .gitignore: 指定Git版本控制系统忽略的文件和目录。
  • .prettierignore: 指定Prettier代码格式化工具忽略的文件和目录。
  • LICENSE: 项目的开源许可证。
  • README.md: 项目的说明文档。
  • package.json: 项目的依赖和脚本配置文件。
  • tsconfig.json: TypeScript配置文件。
  • yarn.lock: Yarn包管理器的锁定文件。

2、项目的启动文件介绍

入口文件

项目的入口文件是 src/index.js,它负责导出项目的主要组件和功能。

import { AnnotationDots } from './components/AnnotationDots';

export const Icon = () => <AnnotationDots />;

启动流程

  1. 安装依赖:npm installyarn install
  2. 链接原生模块:react-native link react-native-iconic
  3. 启动项目:react-native run-androidreact-native run-ios

3、项目的配置文件介绍

package.json

package.json 文件包含了项目的依赖、脚本和其他元数据。

{
  "name": "react-native-iconic",
  "version": "1.0.0",
  "description": "React Native - Native Animated Icons with different states",
  "main": "src/index.js",
  "scripts": {
    "start": "react-native start",
    "android": "react-native run-android",
    "ios": "react-native run-ios",
    "lint": "eslint ."
  },
  "dependencies": {
    "react": "^17.0.2",
    "react-native": "^0.64.2",
    "react-native-svg": "^12.1.1"
  },
  "devDependencies": {
    "eslint": "^7.29.0",
    "prettier": "^2.3.2"
  },
  "license": "Apache-2.0"
}

tsconfig.json

tsconfig.json 文件是TypeScript的配置文件,用于指定编译选项。

{
  "compilerOptions": {
    "target": "esnext",
    "module": "commonjs",
    "allowJs": true,
    "checkJs": true,
    "jsx": "react-native",
    "strict": true,
    "esModuleInterop": true,
    "skipLibCheck": true,
    "forceConsistentCasingInFileNames": true
  },
  "include": ["src"]
}

android/build.gradle

android/build.gradle 文件是Android项目的构建配置文件。

buildscript {
  repositories {
    google()
    jcenter()
  }
  dependencies {
    classpath 'com.android.tools.build:gradle:4.2.1'
  }
}

allprojects {
  repositories {
    mavenLocal()
    google()
    jcenter()
   

react-native-iconicReact Native - Native Animated Icons with different states项目地址:https://gitcode.com/gh_mirrors/re/react-native-iconic

  • 2
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

陆蜜彬

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值