From b78a6421840163026b846ff1ace1af21f52f1c26 Mon Sep 17 00:00:00 2001 From: tyBrave Date: Fri, 28 Nov 2025 17:11:07 +0800 Subject: [PATCH 1/2] =?UTF-8?q?docs:=20[Issues:=20#ID9DTW]=20=E6=9B=B4?= =?UTF-8?q?=E6=96=B0react-native-mjRefresh=E6=8C=87=E5=AF=BC=E6=96=87?= =?UTF-8?q?=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: tyBrave docs: [Issues: #ID9DTW] 更新react-native-mjRefresh指导文档 Signed-off-by: tyBrave docs: [Issues: #ID9DTW] 更新react-native-mjRefresh指导文档 Signed-off-by: tyBrave docs: [Issues: #ID9DTW] 更新react-native-mjRefresh指导文档 Signed-off-by: tyBrave --- en/react-native-MJRefresh.md | 32 ++++++++++++++++++++++---------- zh-cn/react-native-MJRefresh.md | 33 +++++++++++++++++++++++---------- 2 files changed, 45 insertions(+), 20 deletions(-) diff --git a/en/react-native-MJRefresh.md b/en/react-native-MJRefresh.md index 2b9de99f1..ec099b2d7 100644 --- a/en/react-native-MJRefresh.md +++ b/en/react-native-MJRefresh.md @@ -15,9 +15,14 @@ > [!TIP] [Github address](https://github.com/react-native-oh-library/react-native-MJRefresh) -## Installation and Usage +The repository of this third-party library Github and supports direct download from npm. The new package name is: @react-native-ohos/react-native-mjrefresh. The specific version ownership relationship is as follows: -Find the matching version information in the release address of a third-party library: [@react-native-oh-library/react-native-MJRefresh Releases](https://github.com/react-native-oh-library/react-native-MJRefresh/releases).For older versions that are not published to npm, please refer to the [installation guide](/en/tgz-usage-en.md) to install the tgz package. +| Version | Package Name | Repository | Release | Support RN version | +| ---------- | ------------------------------------------------------------ | ---------- | ---------- | ---------- | +| <= 0.7.0-0.2.2@deprecated| @react-native-oh-tpl/react-native-mjrefresh | [Github](https://github.com/react-native-oh-library/react-native-MJRefresh/tree/sig)|[Github Releases](https://github.com/react-native-oh-library/react-native-MJRefresh/releases)|0.72 | +| 0.7.1| @react-native-ohos/react-native-mjrefresh | [GitCode](https://gitcode.com/openharmony-sig/rntpc_react-native-mjrefresh/tree/br_rnoh0.72) |[GitCode Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-mjrefresh/releases) | 0.72 | +| 0.8.0| @react-native-ohos/react-native-mjrefresh | [Github](https://github.com/react-native-oh-library/react-native-MJRefresh/tree/br_rnoh0.77) |[Github Releases]() | 0.77 | +## Installation and Usage Go to the project directory and execute the following instruction: @@ -28,13 +33,13 @@ Go to the project directory and execute the following instruction: #### npm ```bash -npm install @react-native-oh-tpl/react-native-mjrefresh +npm install @react-native-ohos/react-native-mjrefresh ``` #### yarn ```bash -yarn add @react-native-oh-tpl/react-native-mjrefresh +yarn add @react-native-ohos/react-native-mjrefresh ``` @@ -123,7 +128,9 @@ export default class MjRefreshDemo extends Component<{}, State> { ## Link -Currently, HarmonyOS does not support AutoLink. Therefore, you need to manually configure the linking. +Version >= @react-native-ohos/react-native-mjrefresh@0.7.1 now supports Autolink without requiring manual configuration, currently only supports 72 frameworks. Autolink Framework Guide Documentation: https://gitcode.com/openharmony-sig/ohos_react_native/blob/master/docs/zh-cn/Autolinking.md + +This step provides guidance for manually configuring native dependencies. Open the `harmony` directory of the HarmonyOS project in DevEco Studio. @@ -153,7 +160,7 @@ Open `entry/oh-package.json5` file and add the following dependencies: "dependencies": { "@rnoh/react-native-openharmony": "file:../react_native_openharmony", - "@react-native-oh-tpl/react-native-mjrefresh": "file:../../node_modules/@react-native-oh-tpl/react-native-mjrefresh/harmony/mjrefresh.har" + "@react-native-ohos/react-native-mjrefresh": "file:../../node_modules/@react-native-ohos/react-native-mjrefresh/harmony/mjrefresh.har" } ``` @@ -168,10 +175,12 @@ ohpm install Method 2: Directly link to the source code. -> [!TIP] For details, see [Directly Linking Source Code](/en/link-source-code.md). +For details, see [Directly Linking Source Code](/en/link-source-code.md). ### 3. Configuring CMakeLists and Introducing MJRefreshPackge +> If you are using version <= 0.7.0-0.2.2, please skip this chapter. + Open `entry/src/main/cpp/CMakeLists.txt` and add the following code: ```diff @@ -192,7 +201,7 @@ add_subdirectory("${RNOH_CPP_DIR}" ./rn) # RNOH_BEGIN: manual_package_linking_1 add_subdirectory("../../../../sample_package/src/main/cpp" ./sample-package) -+ add_subdirectory("${OH_MODULES}/@react-native-oh-tpl/react-native-mjrefresh/src/main/cpp" ./mjrefresh) ++ add_subdirectory("${OH_MODULES}/@react-native-ohos/react-native-mjrefresh/src/main/cpp" ./mjrefresh) # RNOH_END: manual_package_linking_1 file(GLOB GENERATED_CPP_FILES "./generated/*.cpp") @@ -244,9 +253,12 @@ Then build and run the code. ### Compatibility -To use this repository, you need to use the correct React-Native and RNOH versions. In addition, you need to use DevEco Studio and the ROM on your phone. +The content of this document has been verified based on the following version: + -Check the release version information in the release address of the third-party library: [@react-native-oh-library/react-native-MJRefresh Releases](https://github.com/react-native-oh-library/react-native-MJRefresh/releases) +1. RNOH: 0.72.96; SDK: HarmonyOS 6.0.0 Release SDK; IDE: DevEco Studio 6.0.0.858; ROM: 6.0.0.112; +2. RNOH: 0.72.33; SDK: HarmonyOS NEXT B1; IDE: DevEco Studio: 5.0.3.900; ROM: Next.0.0.71; +3. RNOH: 0.77.18; SDK: HarmonyOS 6.0.0 Release SDK; IDE: DevEco Studio 6.0.0.858; ROM: 6.0.0.112; ## Properties diff --git a/zh-cn/react-native-MJRefresh.md b/zh-cn/react-native-MJRefresh.md index 1d5f639f2..6a02b0d05 100644 --- a/zh-cn/react-native-MJRefresh.md +++ b/zh-cn/react-native-MJRefresh.md @@ -15,9 +15,15 @@ > [!TIP] [Github 地址](https://github.com/react-native-oh-library/react-native-MJRefresh) -## 安装与使用 +该第三方库的仓库Github上,且支持直接从 npm 下载,新的包名为:@react-native-ohos/react-native-mjrefresh,具体版本所属关系如下: + +| 三方库版本 | 包名 | 仓库地址 | 发布(Release) | 支持RN版本 | +| ---------- | ------------------------------------------------------------ | ---------- | ---------- | ---------- | +| <= 0.7.0-0.2.2@deprecated | @react-native-oh-tpl/react-native-mjrefresh | [Github](https://github.com/react-native-oh-library/react-native-MJRefresh/tree/sig)|[Github Releases](https://github.com/react-native-oh-library/react-native-MJRefresh/releases)|0.72 | +| 0.7.1| @react-native-ohos/react-native-mjrefresh | [GitCode](https://gitcode.com/openharmony-sig/rntpc_react-native-mjrefresh/tree/br_rnoh0.72) |[GitCode Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-mjrefresh/releases) | 0.72 | +| 0.8.0| @react-native-ohos/react-native-mjrefresh | [Github](https://github.com/react-native-oh-library/react-native-MJRefresh/tree/br_rnoh0.77) |[Github Releases]() | 0.77 | -请到三方库的 Releases 发布地址查看配套的版本信息:[@react-native-oh-library/react-native-MJRefresh Releases](https://github.com/react-native-oh-library/react-native-MJRefresh/releases) 。对于未发布到npm的旧版本,请参考[安装指南](/zh-cn/tgz-usage.md)安装tgz包。 +## 安装与使用 进入到工程目录并输入以下命令: @@ -26,13 +32,13 @@ #### npm ```bash -npm install @react-native-oh-tpl/react-native-mjrefresh +npm install @react-native-ohos/react-native-mjrefresh ``` #### yarn ```bash -yarn add @react-native-oh-tpl/react-native-mjrefresh +yarn add @react-native-ohos/react-native-mjrefresh ``` @@ -121,7 +127,10 @@ export default class MjRefreshDemo extends Component<{}, State> { ## Link -目前 HarmonyOS 暂不支持 AutoLink,所以 Link 步骤需要手动配置。 +Version >= @react-native-ohos/react-native-mjrefresh@0.7.1,已支持 Autolink,无需手动配置,目前只支持72框架。 +Autolink框架指导文档:https://gitcode.com/openharmony-sig/ohos_react_native/blob/master/docs/zh-cn/Autolinking.md + +此步骤为手动配置原生依赖项的指导。 首先需要使用 DevEco Studio 打开项目里的 HarmonyOS 工程 `harmony` @@ -153,7 +162,7 @@ export default class MjRefreshDemo extends Component<{}, State> { "dependencies": { "@rnoh/react-native-openharmony": "file:../react_native_openharmony", - "@react-native-oh-tpl/react-native-mjrefresh": "file:../../node_modules/@react-native-oh-tpl/react-native-mjrefresh/harmony/mjrefresh.har" + "@react-native-ohos/react-native-mjrefresh": "file:../../node_modules/@react-native-ohos/react-native-mjrefresh/harmony/mjrefresh.har" } ``` @@ -168,10 +177,12 @@ ohpm install 方法二:直接链接源码 -> [!TIP] 如需使用直接链接源码,请参考[直接链接源码说明](/zh-cn/link-source-code.md) +如需使用直接链接源码,请参考[直接链接源码说明](/zh-cn/link-source-code.md) ### 3.配置 CMakeLists 和引入 MJRefreshPackge +> 若使用的是 <= 0.7.0-0.2.2 版本,请跳过本章。 + 打开 `entry/src/main/cpp/CMakeLists.txt`,添加: ```diff @@ -192,7 +203,7 @@ add_subdirectory("${RNOH_CPP_DIR}" ./rn) # RNOH_BEGIN: manual_package_linking_1 add_subdirectory("../../../../sample_package/src/main/cpp" ./sample-package) -+ add_subdirectory("${OH_MODULES}/@react-native-oh-tpl/react-native-mjrefresh/src/main/cpp" ./mjrefresh) ++ add_subdirectory("${OH_MODULES}/@react-native-ohos/react-native-mjrefresh/src/main/cpp" ./mjrefresh) # RNOH_END: manual_package_linking_1 file(GLOB GENERATED_CPP_FILES "./generated/*.cpp") @@ -244,9 +255,11 @@ ohpm install ### 兼容性 -要使用此库,需要使用正确的 React-Native 和 RNOH 版本。另外,还需要使用配套的 DevEco Studio 和 手机 ROM。 +本文档内容基于以下版本验证通过: -请到三方库相应的 Releases 发布地址查看 Release 配套的版本信息:[@react-native-oh-library/react-native-MJRefresh Releases](https://github.com/react-native-oh-library/react-native-MJRefresh/releases) +1. RNOH: 0.72.96; SDK: HarmonyOS 6.0.0 Release SDK; IDE: DevEco Studio 6.0.0.858; ROM: 6.0.0.112; +2. RNOH: 0.72.33; SDK: HarmonyOS NEXT B1; IDE: DevEco Studio: 5.0.3.900; ROM: Next.0.0.71; +3. RNOH: 0.77.18; SDK: HarmonyOS 6.0.0 Release SDK; IDE: DevEco Studio 6.0.0.858; ROM: 6.0.0.112; ## 属性 -- Gitee From 756b55beda282965b5eff86ea7de2c65ee82143c Mon Sep 17 00:00:00 2001 From: tyBrave Date: Sat, 13 Dec 2025 18:01:21 +0800 Subject: [PATCH 2/2] =?UTF-8?q?docs:=20[Issues:=20#ID9DTW]=20=E6=9B=B4?= =?UTF-8?q?=E6=96=B0react-native-mjRefresh=E6=8C=87=E5=AF=BC=E6=96=87?= =?UTF-8?q?=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: tyBrave --- en/react-native-MJRefresh.md | 2 +- zh-cn/react-native-MJRefresh.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/en/react-native-MJRefresh.md b/en/react-native-MJRefresh.md index 5b1bdaaaa..b2e064519 100644 --- a/en/react-native-MJRefresh.md +++ b/en/react-native-MJRefresh.md @@ -21,7 +21,7 @@ The repository of this third-party library Github and supports direct download f | ---------- | ------------------------------------------------------------ | ---------- | ---------- | ---------- | | <= 0.7.0-0.2.2@deprecated| @react-native-oh-tpl/react-native-mjrefresh | [Github](https://github.com/react-native-oh-library/react-native-MJRefresh/tree/sig)|[Github Releases](https://github.com/react-native-oh-library/react-native-MJRefresh/releases)|0.72 | | 0.7.1| @react-native-ohos/react-native-mjrefresh | [GitCode](https://gitcode.com/openharmony-sig/rntpc_react-native-mjrefresh/tree/br_rnoh0.72) |[GitCode Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-mjrefresh/releases) | 0.72 | -| 0.8.0| @react-native-ohos/react-native-mjrefresh | [Github](https://github.com/react-native-oh-library/react-native-MJRefresh/tree/br_rnoh0.77) |[Github Releases]() | 0.77 | +| 0.8.0| @react-native-ohos/react-native-mjrefresh | [Github](https://github.com/react-native-oh-library/react-native-MJRefresh/tree/br_rnoh0.77) |[Github Releases](https://github.com/react-native-oh-library/react-native-MJRefresh/releases) | 0.77 | ## Installation and Usage Go to the project directory and execute the following instruction: diff --git a/zh-cn/react-native-MJRefresh.md b/zh-cn/react-native-MJRefresh.md index 9ce80b471..ebf951058 100644 --- a/zh-cn/react-native-MJRefresh.md +++ b/zh-cn/react-native-MJRefresh.md @@ -21,7 +21,7 @@ | ---------- | ------------------------------------------------------------ | ---------- | ---------- | ---------- | | <= 0.7.0-0.2.2@deprecated | @react-native-oh-tpl/react-native-mjrefresh | [Github](https://github.com/react-native-oh-library/react-native-MJRefresh/tree/sig)|[Github Releases](https://github.com/react-native-oh-library/react-native-MJRefresh/releases)|0.72 | | 0.7.1| @react-native-ohos/react-native-mjrefresh | [GitCode](https://gitcode.com/openharmony-sig/rntpc_react-native-mjrefresh/tree/br_rnoh0.72) |[GitCode Releases](https://gitcode.com/openharmony-sig/rntpc_react-native-mjrefresh/releases) | 0.72 | -| 0.8.0| @react-native-ohos/react-native-mjrefresh | [Github](https://github.com/react-native-oh-library/react-native-MJRefresh/tree/br_rnoh0.77) |[Github Releases]() | 0.77 | +| 0.8.0| @react-native-ohos/react-native-mjrefresh | [Github](https://github.com/react-native-oh-library/react-native-MJRefresh/tree/br_rnoh0.77) |[Github Releases](https://github.com/react-native-oh-library/react-native-MJRefresh/releases) | 0.77 | ## 安装与使用 -- Gitee