From b81a1a8eff693d7a96dc9b065b6cd259b6c00651 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=BD=97=E5=9D=A4?= Date: Mon, 8 Apr 2024 18:19:28 +0800 Subject: [PATCH 1/3] =?UTF-8?q?feat:=20=E5=B0=86@ant-design/icons-react-na?= =?UTF-8?q?tive=E3=80=81react-native-gesture-handler=E5=8A=A0=E5=85=A5?= =?UTF-8?q?=E5=88=B0peerDependencies?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 13 ++++++++++--- package.json | 9 ++++----- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 10d77436..72843057 100644 --- a/README.md +++ b/README.md @@ -99,21 +99,28 @@ yarn add @ant-design/react-native ### Installing peer dependencies ```bash -npm install @react-native-community/segmented-control @react-native-community/slider +npm install @react-native-community/segmented-control @react-native-community/slider @ant-design/icons-react-native react-native-gesture-handler ``` or ```bash -yarn add @react-native-community/segmented-control @react-native-community/slider +yarn add @react-native-community/segmented-control @react-native-community/slider @ant-design/icons-react-native react-native-gesture-handler ``` > You need go to ios folder and run `pod install` (auto linking),Android will handle it by itself. ### Link icon fonts +- config `react-native.config.js` in project’s root directory +```js +module.exports = { + assets: ['node_modules/@ant-design/icons-react-native/fonts'], +}; +``` + - command then ```bash -npx react-native link +npx react-native-asset ``` [introduce](docs/react/introduce.en-US.md#安装) diff --git a/package.json b/package.json index 746421b1..b105f424 100644 --- a/package.json +++ b/package.json @@ -24,14 +24,12 @@ }, "files": [ "lib", - "es", - "react-native.config.js" + "es" ], "license": "MIT", "main": "lib/index.js", "module": "es/index.js", "dependencies": { - "@ant-design/icons-react-native": "^2.3.1", "@bang88/react-native-ultimate-listview": "^4.1.0", "@types/shallowequal": "^1.1.1", "babel-runtime": "^6.x", @@ -42,7 +40,6 @@ "rc-util": "^4.21.1", "react-native-codegen": "^0.0.7", "react-native-collapsible": "^1.6.0", - "react-native-gesture-handler": "~2.2.1", "react-native-modal-popover": "^2.0.1", "shallowequal": "^1.1.0", "utility-types": "^3.10.0" @@ -99,10 +96,12 @@ "typescript": "^4.3.2" }, "peerDependencies": { + "@ant-design/icons-react-native": ">= 2.3.1", "@react-native-community/segmented-control": ">= 1.4.0", "@react-native-community/slider": ">= 2.0.0", "react": ">=17.0.1", - "react-native": ">=0.64.1" + "react-native": ">=0.64.1", + "react-native-gesture-handler": ">=2.2.1" }, "scripts": { "lint": "npm run tslint && npm run srclint && npm run applint", From ffbffcd6d0db0afd236ad3dbe5948364e491840e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=BD=97=E5=9D=A4?= Date: Mon, 8 Apr 2024 18:40:00 +0800 Subject: [PATCH 2/3] feat: update README.md --- README.md | 6 +++--- README.zh-CN.md | 16 ++++++++++++---- docs/react/introduce.en-US.md | 14 +++++++++++++- docs/react/introduce.zh-CN.md | 15 ++++++++++++++- 4 files changed, 42 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 72843057..4f0c6af7 100644 --- a/README.md +++ b/README.md @@ -112,18 +112,18 @@ yarn add @react-native-community/segmented-control @react-native-community/slide ### Link icon fonts -- config `react-native.config.js` in project’s root directory ```js +// config `react-native.config.js` in project’s root directory module.exports = { assets: ['node_modules/@ant-design/icons-react-native/fonts'], }; ``` - - command then +then ```bash npx react-native-asset ``` -[introduce](docs/react/introduce.en-US.md#安装) +[introduce](docs/react/introduce.en-US.md#2-installation) ## Links diff --git a/README.zh-CN.md b/README.zh-CN.md index ae8f6217..324d8704 100644 --- a/README.zh-CN.md +++ b/README.zh-CN.md @@ -110,14 +110,22 @@ yarn add @react-native-community/segmented-control @react-native-community/slide > 安装完依赖后需要到 iOS 目录 `pod install`(auto linking),Android 不需要手动处理 -### 链接字体图标以及自动链接 +### 链接字体图标 + +```js +// 配置根目录下的 `react-native.config.js` 文件 +module.exports = { + assets: ['node_modules/@ant-design/icons-react-native/fonts'], +}; +``` +然后 ```bash -# 手动链接字体图标 -npx react-native link +# 手动执行命令 +npx react-native-asset ``` -[介绍](docs/react/introduce.zh-CN.md#安装) +[介绍](docs/react/introduce.zh-CN.md#2-安装) ## 链接 diff --git a/docs/react/introduce.en-US.md b/docs/react/introduce.en-US.md index 6f2b9b2d..4c794994 100644 --- a/docs/react/introduce.en-US.md +++ b/docs/react/introduce.en-US.md @@ -80,9 +80,21 @@ or $ yarn add @ant-design/icons-react-native ``` +
+Add assets to your `react-native.config.js` ( If not exist, please create in project’s root directory ) + +```js +module.exports = { + assets: ['node_modules/@ant-design/icons-react-native/fonts'], +}; +``` + +Run the [`react-native-asset`](https://github.com/unimonkiez/react-native-asset)'s command and linking + unlinking is automatic + ```bash -$ npx react-native link @ant-design/icons-react-native +npx react-native-asset ``` +
> If you are using expo please make sure fonts has been loaded diff --git a/docs/react/introduce.zh-CN.md b/docs/react/introduce.zh-CN.md index 503dffd4..c1f82115 100644 --- a/docs/react/introduce.zh-CN.md +++ b/docs/react/introduce.zh-CN.md @@ -80,9 +80,22 @@ or $ yarn add @ant-design/icons-react-native ``` +
+ +将字体资源路径配置到根目录下的 `react-native.config.js` 文件中 ( 如果没有,请创建 ) + +```js +module.exports = { + assets: ['node_modules/@ant-design/icons-react-native/fonts'], +}; +``` + +然后执行[`react-native-asset`](https://github.com/unimonkiez/react-native-asset)的命令 + ```bash -$ npx react-native link @ant-design/icons-react-native +npx react-native-asset ``` +
> 如果你用的是 expo 请确保字体已经加载完成再初始化 app From 870751294512e6d378135132adbc92126b629c4d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=BD=97=E5=9D=A4?= Date: Mon, 15 Apr 2024 10:53:19 +0800 Subject: [PATCH 3/3] bump 5.1.2 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index b105f424..6b336580 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@ant-design/react-native", - "version": "5.1.1", + "version": "5.1.2", "description": "基于蚂蚁金服移动设计规范的 React Native 组件库", "keywords": [ "ant",