From 6e777d79f7caa3065c44dd58f3cef8eec7a8384f Mon Sep 17 00:00:00 2001 From: 13415019609 Date: Sat, 9 Aug 2025 17:02:15 +0800 Subject: [PATCH] =?UTF-8?q?docs:=20[Issues:=20#ICS6ON]=20=E6=B7=BB?= =?UTF-8?q?=E5=8A=A00.77=2010=E4=B8=AA=E4=B8=89=E6=96=B9=E5=BA=93=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: 13415019609 --- zh-cn/react-native-amap-geolocation.md | 30 ++++++++++- zh-cn/react-native-exception-handler.md | 19 ++++++- zh-cn/react-native-image-marker.md | 38 +++++++++++++- zh-cn/react-native-image-viewing.md | 10 +++- ...react-native-keyboard-aware-scroll-view.md | 10 +++- zh-cn/react-native-linear-gradient.md | 10 ++-- zh-cn/react-native-orientation-locker.md | 52 +++++++++++++++++-- zh-cn/react-native-picker.md | 10 +++- zh-cn/react-native-slider.md | 20 +++++-- zh-cn/react-native-udp.md | 39 ++++++++++++-- 10 files changed, 216 insertions(+), 22 deletions(-) diff --git a/zh-cn/react-native-amap-geolocation.md b/zh-cn/react-native-amap-geolocation.md index 58aa7f9f..b23f1fc5 100644 --- a/zh-cn/react-native-amap-geolocation.md +++ b/zh-cn/react-native-amap-geolocation.md @@ -19,7 +19,12 @@ ## 安装与使用 -请到三方库的 Releases 发布地址查看配套的版本信息:[@react-native-oh-tpl/react-native-amap-geolocation Releases](https://github.com/react-native-oh-library/react-native-amap-geolocation/releases) 。对于未发布到npm的旧版本,请参考[安装指南](/zh-cn/tgz-usage.md)安装tgz包。 +请到三方库的 Releases 发布地址查看配套的版本信息,并下载适用版本的 tgz 包: + +| 三方库版本 | 发布信息 | 支持RN版本 | +| ----------- | ------------------------------------------------------------ | ---------- | +| 1.2.3-0.0.5 | [@react-native-oh-tpl/react-native-amap-geolocation](https://github.com/react-native-oh-library/react-native-image-capinsets-next/releases) | 0.72 | +| 1.2.3-0.0.5 | [@react-native-oh-ohos/react-native-amap-geolocation]() | 0.77 | 进入到工程目录并输入以下命令: @@ -27,16 +32,32 @@ #### **npm** +v1.2.3-0.0.5 + ```bash npm install @react-native-oh-tpl/react-native-amap-geolocation ``` +v1.2.3-0.0.5 + +``` +npm install @react-native-oh-ohos/react-native-amap-geolocation +``` + #### **yarn** +v1.2.3-0.0.5 + ```bash yarn add @react-native-oh-tpl/react-native-amap-geolocation ``` +v1.2.3-0.0.5 + +```bash +yarn add @react-native-oh-ohos/react-native-amap-geolocation +``` + 下面的代码展示了这个库的基本使用场景: @@ -362,7 +383,12 @@ ohpm install 要使用此库,需要使用正确的 React-Native 和 RNOH 版本。另外,还需要使用配套的 DevEco Studio 和 手机 ROM。 -请到三方库相应的 Releases 发布地址查看 Release 配套的版本信息:[@react-native-oh-tpl/react-native-amap-geolocation Releases](https://github.com/react-native-oh-library/react-native-amap-geolocation/releases) +请到三方库的 Releases 发布地址查看配套的版本信息,并下载适用版本的 tgz 包: + +| 三方库版本 | 发布信息 | 支持RN版本 | +| ----------- | ------------------------------------------------------------ | ---------- | +| 1.2.3-0.0.5 | [@react-native-oh-tpl/react-native-amap-geolocation](https://github.com/react-native-oh-library/react-native-image-capinsets-next/releases) | 0.72 | +| 1.2.3-0.0.5 | [@react-native-oh-ohos/react-native-amap-geolocation]() | 0.77 | ### 权限要求 diff --git a/zh-cn/react-native-exception-handler.md b/zh-cn/react-native-exception-handler.md index c991de88..45de09b2 100644 --- a/zh-cn/react-native-exception-handler.md +++ b/zh-cn/react-native-exception-handler.md @@ -16,8 +16,13 @@ ## 安装与使用 -请到三方库的 Releases 发布地址查看配套的版本信息:[@react-native-oh-tpl/react-native-exception-handler Releases](https://github.com/react-native-oh-library/react-native-exception-handler/releases) 。对于未发布到npm的旧版本,请参考[安装指南](/zh-cn/tgz-usage.md)安装tgz包。 +请到三方库相应的 Releases 发布地址查看 Release 配套的版本信息: +| 三方库版本 | 发布信息 | 支持RN版本 | +| ---------- | ------------------------------------------------------------ | ---------- | +| 2.10.10 | [@react-native-oh-tpl/react-native-exception-handler Releases](https://github.com/react-native-oh-library/react-native-exception-handler/releases) | 0.72 | +| 2.10.10 | [@react-native-oh-tpl/react-native-exception-handler Releases]() | 0.77 | +对于未发布到npm的旧版本,请参考[安装指南](/zh-cn/tgz-usage.md)安装tgz包。 进入到工程目录并输入以下命令: @@ -25,12 +30,14 @@ #### **npm** ```bash +#v2.10.10 npm install @react-native-oh-tpl/react-native-exception-handler ``` #### **yarn** ```bash +#v2.10.10 yarn add @react-native-oh-tpl/react-native-exception-handler ``` @@ -144,6 +151,7 @@ export const ReactNativeExceptionHandler = () => { > [!TIP] har 包位于三方库安装路径的 `harmony` 文件夹下。 打开 `entry/oh-package.json5`,添加以下依赖 +- V2.10.10 ```json "dependencies": { @@ -168,6 +176,8 @@ ohpm install ### 3.配置 CMakeLists 和引入 ExceptionHandlerPackage +> [!TIP] V2.10.10 需要配置CMakeLists 和引入 RNBackgroundFetchPackage。 + 打开 `entry/src/main/cpp/CMakeLists.txt`,添加: ```diff @@ -229,6 +239,7 @@ std::vector> PackageProvider::getPackages(Package::Cont ```diff ... + //v2.10.10 + import {ExceptionHandlerPackage} from '@react-native-oh-tpl/react-native-exception-handler/ts'; export function createRNPackages(ctx: RNPackageContext): RNPackage[] { @@ -257,7 +268,11 @@ ohpm install 要使用此库,需要使用正确的 React-Native 和 RNOH 版本。另外,还需要使用配套的 DevEco Studio 和 手机 ROM。 -请到三方库相应的 Releases 发布地址查看 Release 配套的版本信息:[@react-native-oh-tpl/reace-native-exception-handler Releases](https://github.com/react-native-oh-library/react-native-exception-handler/releases) +请到三方库相应的 Releases 发布地址查看 Release 配套的版本信息: +| 三方库版本 | 发布信息 | 支持RN版本 | +| ---------- | ------------------------------------------------------------ | ---------- | +| 2.10.10 | [@react-native-oh-tpl/react-native-exception-handler Releases](https://github.com/react-native-oh-library/react-native-exception-handler/releases) | 0.72 | +| 2.10.10 | [@react-native-oh-tpl/react-native-exception-handler Releases]() | 0.77 | ## 静态方法 diff --git a/zh-cn/react-native-image-marker.md b/zh-cn/react-native-image-marker.md index d153019f..dcc1a61f 100644 --- a/zh-cn/react-native-image-marker.md +++ b/zh-cn/react-native-image-marker.md @@ -17,7 +17,14 @@ ## 安装与使用 -请到三方库的 Releases 发布地址查看配套的版本信息:[@react-native-oh-tpl/react-native-image-marker Releases](https://github.com/react-native-oh-library/react-native-image-marker/releases)。对于未发布到npm的旧版本,请参考[安装指南](/zh-cn/tgz-usage.md)安装tgz包。 +请到三方库的 Releases 发布地址查看配套的版本信息: + +| 三方库版本 | 发布信息 | 支持RN版本 | +| ---------- | ------------------------------------------------------------ | ---------- | +| 1.2.6 | [@react-native-oh-tpl/react-native-image-marker Releases](https://github.com/react-native-oh-library/react-native-image-marker/releases) | 0.72 | +| 1.2.6 | [@react-native-ohos/react-native-image-marker Releases]() | 0.77 | + +对于未发布到npm的旧版本,请参考[安装指南](/zh-cn/tgz-usage.md)安装tgz包。 进入到工程目录并输入以下命令: @@ -28,13 +35,21 @@ #### **npm** ```bash +# V1.2.6 npm install @react-native-oh-tpl/react-native-image-marker + +# V1.2.6 +npm install @react-native-ohos/react-native-image-marker ``` #### **yarn** ```bash +# V1.2.6 yarn add @react-native-oh-tpl/react-native-image-marker + +# V1.2.6 +yarn add @react-native-ohos/react-native-image-marker ``` @@ -220,6 +235,8 @@ export const ImageMarkerText = () => { 打开 `entry/oh-package.json5`,添加以下依赖 +- V1.2.6 + ```json "dependencies": { "@rnoh/react-native-openharmony": "file:../react_native_openharmony", @@ -227,6 +244,15 @@ export const ImageMarkerText = () => { } ``` +- V1.2.6 + +```json +"dependencies": { + "@rnoh/react-native-openharmony": "file:../react_native_openharmony", + "@react-native-ohos/react-native-image-marker": "file:../../node_modules/@react-native-ohos/react-native-image-marker/harmony/image_marker.har" + } +``` + 点击右上角的 `sync` 按钮 或者在终端执行: @@ -246,8 +272,11 @@ ohpm install ```diff ... +// V1.2.6 + import {RNImageMarkerPackage} from '@react-native-oh-tpl/react-native-image-marker/ts'; +// V1.2.6 ++ import {RNImageMarkerPackage} from '@react-native-ohos/react-native-image-marker/ts'; export function createRNPackages(ctx: RNPackageContext): RNPackage[] { return [ @@ -276,7 +305,12 @@ ohpm install 要使用此库,需要使用正确的 React-Native 和 RNOH 版本。另外,还需要使用配套的 DevEco Studio 和 手机 ROM。 -请到三方库相应的 Releases 发布地址查看 Release 配套的版本信息:[@react-native-oh-tpl/react-native-image-marker Releases](https://github.com/react-native-oh-library/react-native-image-marker/releases) +请到三方库相应的 Releases 发布地址查看 Release 配套的版本信息: + +| 三方库版本 | 发布信息 | 支持RN版本 | +| ---------- | ------------------------------------------------------------ | ---------- | +| 1.2.6 | [@react-native-oh-tpl/react-native-image-marker Releases](https://github.com/react-native-oh-library/react-native-image-marker/releases) | 0.72 | +| 1.2.6 | [@react-native-ohos/react-native-image-marker Releases]() | 0.77 | ### 权限要求 diff --git a/zh-cn/react-native-image-viewing.md b/zh-cn/react-native-image-viewing.md index 65a43cdc..977075ae 100644 --- a/zh-cn/react-native-image-viewing.md +++ b/zh-cn/react-native-image-viewing.md @@ -17,7 +17,13 @@ ## 安装与使用 -请到三方库的 Releases 发布地址查看配套的版本信息:[@react-native-oh-tpl/react-native-image-viewing Releases](https://github.com/react-native-oh-library/react-native-image-viewing/releases) 。对于未发布到npm的旧版本,请参考[安装指南](/zh-cn/tgz-usage.md)安装tgz包。 +请到三方库相应的 Releases 发布地址查看 Release 配套的版本信息: +| 三方库版本 | 发布信息 | 支持RN版本 | +| ---------- | ------------------------------------------------------------ | ---------- | +| 0.2.2 |[@react-native-oh-tpl/react-native-image-viewing Releases](https://github.com/react-native-oh-library/react-native-image-viewing/releases) | 0.72 | +| 0.2.2 |[@react-native-oh-tpl/react-native-image-viewing Releases]() | 0.77 | + +对于未发布到npm的旧版本,请参考[安装指南](/zh-cn/tgz-usage.md)安装tgz包。 进入到工程目录并输入以下命令: @@ -28,12 +34,14 @@ #### npm ```bash +#0.2.2 npm install @react-native-oh-tpl/react-native-image-viewing ``` #### yarn ```bash +#0.2.2 yarn add @react-native-oh-tpl/react-native-image-viewing ``` diff --git a/zh-cn/react-native-keyboard-aware-scroll-view.md b/zh-cn/react-native-keyboard-aware-scroll-view.md index 2a9db5b2..fccb8a78 100644 --- a/zh-cn/react-native-keyboard-aware-scroll-view.md +++ b/zh-cn/react-native-keyboard-aware-scroll-view.md @@ -16,7 +16,13 @@ ## 安装与使用 -请到三方库的 Releases 发布地址查看配套的版本信息:[@react-native-oh-tpl/react-native-keyboard-aware-scroll-view Releases](https://github.com/react-native-oh-library/react-native-keyboard-aware-scroll-view/releases) 。对于未发布到npm的旧版本,请参考[安装指南](/zh-cn/tgz-usage.md)安装tgz包。 +请到三方库相应的 Releases 发布地址查看 Release 配套的版本信息: +| 三方库版本 | 发布信息 | 支持RN版本 | +| ---------- | ------------------------------------------------------------ | ---------- | +| 0.9.5 | [@react-native-oh-tpl/react-native-keyboard-aware-scroll-view Releases](https://github.com/react-native-oh-library/react-native-keyboard-aware-scroll-view/releases) | 0.72 | +| 0.9.5 | [@react-native-oh-tpl/react-native-keyboard-aware-scroll-view Releases]() | 0.77 | + +对于未发布到npm的旧版本,请参考[安装指南](/zh-cn/tgz-usage.md)安装tgz包。 进入到工程目录并输入以下命令: @@ -25,12 +31,14 @@ #### **npm** ```bash +#v0.9.5 npm install @react-native-oh-tpl/react-native-keyboard-aware-scroll-view ``` #### **yarn** ```bash +#v0.9.5 yarn add @react-native-oh-tpl/react-native-keyboard-aware-scroll-view ``` diff --git a/zh-cn/react-native-linear-gradient.md b/zh-cn/react-native-linear-gradient.md index 6da3ab66..a8cfcdfc 100644 --- a/zh-cn/react-native-linear-gradient.md +++ b/zh-cn/react-native-linear-gradient.md @@ -8,10 +8,12 @@ 该第三方库的仓库已迁移至 Gitee,且支持直接从 npm 下载,新的包名为:`@react-native-ohos/react-native-linear-gradient`,具体版本所属关系如下: -| Version | Package Name | Repository | Release | -| ------------------------- | ------------------------------------------------- | ------------------ | -------------------------- | -| <= 3.0.0-0.5.0@deprecated | @react-native-oh-tpl/react-native-linear-gradient | [Github(deprecated)](https://github.com/react-native-oh-library/react-native-linear-gradient) | [Github Releases(deprecated)](https://github.com/react-native-oh-library/react-native-linear-gradient/releases) | -| > 3.0.0 | @react-native-ohos/react-native-linear-gradient | [Gitee](https://gitee.com/openharmony-sig/rntpc_react-native-linear-gradient) | [Gitee Releases](https://gitee.com/openharmony-sig/rntpc_react-native-linear-gradient/releases) | +| Version | Package Name | Repository | Release | Version for RN | +| ------------------------- | ------------------------------------------------- | ------------------ | -------------------------- | ------------------------- | +|<= 3.0.0-0.5.0@deprecated | @react-native-oh-tpl/react-native-linear-gradient | [Github(deprecated)](https://github.com/react-native-oh-library/react-native-linear-gradient) | [Github Releases(deprecated)](https://github.com/react-native-oh-library/react-native-linear-gradient/releases) | 0.72 | +| > 3.0.0 | @react-native-ohos/react-native-linear-gradient | [Gitee](https://gitee.com/openharmony-sig/rntpc_react-native-linear-gradient) | [Gitee Releases](https://gitee.com/openharmony-sig/rntpc_react-native-linear-gradient/releases) | 0.72/0.77 | + + ## 1. 安装与使用 diff --git a/zh-cn/react-native-orientation-locker.md b/zh-cn/react-native-orientation-locker.md index 45394872..6a480c7e 100644 --- a/zh-cn/react-native-orientation-locker.md +++ b/zh-cn/react-native-orientation-locker.md @@ -16,23 +16,37 @@ ## 安装与使用 -请到三方库的 Releases 发布地址查看配套的版本信息:[@react-native-oh-library/react-native-orientation-locker Releases](https://github.com/react-native-oh-library/react-native-orientation-locker/releases) 。对于未发布到npm的旧版本,请参考[安装指南](/zh-cn/tgz-usage.md)安装tgz包。 +请到三方库的 Releases 发布地址查看配套的版本信息: -进入到工程目录并输入以下命令: +| 三方库版本 | 发布信息 | 支持RN版本 | +| ---------- | ------------------------------------------------------------ | ---------- | +| 1.7.0 | [@react-native-oh-library/react-native-orientation-locker Releases](https://github.com/react-native-oh-library/react-native-orientation-locker/releases) | 0.72 | +| 1.7.0 | [@react-native-ohos/react-native-orientation-locker Releases]() | 0.77 | + +对于未发布到npm的旧版本,请参考[安装指南](/zh-cn/tgz-usage.md)安装tgz包。 +进入到工程目录并输入以下命令: #### npm ```bash +# V1.7.0 npm install @react-native-oh-tpl/react-native-orientation-locker + +# V1.7.0 +npm install @react-native-ohos/react-native-orientation-locker ``` #### yarn ```bash +# V1.7.0 yarn add @react-native-oh-tpl/react-native-orientation-locker + +# V1.7.0 +yarn add @react-native-ohos/react-native-orientation-locker ``` @@ -241,6 +255,8 @@ const styles = StyleSheet.create({ 打开 `entry/oh-package.json5`,添加以下依赖 +- V1.7.0 + ```json "dependencies": { "@rnoh/react-native-openharmony": "file:../react_native_openharmony", @@ -248,6 +264,15 @@ const styles = StyleSheet.create({ } ``` +- V1.7.0 + +```json +"dependencies": { + "@rnoh/react-native-openharmony": "file:../react_native_openharmony", + "@react-native-ohos/react-native-orientation-locker":"file:../../node_modules/@react-native-ohos/react-native-orientation-locker/harmony/orientation_locker.har" + } +``` + 点击右上角的 `sync` 按钮 或者在终端执行: @@ -263,6 +288,8 @@ ohpm install 打开 `entry/oh-package.json5`,添加以下依赖 +- V1.7.0 + ```json "dependencies": { "@rnoh/react-native-openharmony": "file:../react_native_openharmony", @@ -270,6 +297,15 @@ ohpm install } ``` +- V1.7.0 + +```json +"dependencies": { + "@rnoh/react-native-openharmony": "file:../react_native_openharmony", + "@react-native-ohos/react-native-orientation-locker":"file:../../node_modules/@react-native-ohos/react-native-orientation-locker/harmony/orientation_locker" + } +``` + 打开终端,执行: ```bash @@ -283,7 +319,12 @@ ohpm install --no-link ```diff ... +// V1.7.0 + import { RNOrientationLockerPackage } from '@react-native-oh-tpl/react-native-orientation-locker/ts'; + +// V1.7.0 ++ import { RNOrientationLockerPackage } from '@react-native-ohos/react-native-orientation-locker/ts'; + export function createRNPackages(ctx: RNPackageContext): RNPackage[] { return [ new SamplePackage(ctx), @@ -311,7 +352,12 @@ ohpm install 要使用此库,需要使用正确的 React-Native 和 RNOH 版本。另外,还需要使用配套的 DevEco Studio 和 手机 ROM。 -请到三方库相应的 Releases 发布地址查看 Release 配套的版本信息:[@react-native-oh-library/react-native-orientation-locker Releases](https://github.com/react-native-oh-library/react-native-orientation-locker/releases) +请到三方库相应的 Releases 发布地址查看 Release 配套的版本信息: + +| 三方库版本 | 发布信息 | 支持RN版本 | +| ---------- | ------------------------------------------------------------ | ---------- | +| 1.7.0 | [@react-native-oh-library/react-native-orientation-locker Releases](https://github.com/react-native-oh-library/react-native-orientation-locker/releases) | 0.72 | +| 1.7.0 | [@react-native-ohos/react-native-orientation-locker Releases]() | 0.77 | 本文档内容基于以下版本验证通过: diff --git a/zh-cn/react-native-picker.md b/zh-cn/react-native-picker.md index 31abd460..d8b1346f 100644 --- a/zh-cn/react-native-picker.md +++ b/zh-cn/react-native-picker.md @@ -16,7 +16,13 @@ ## 安装与使用 -请到三方库的 Releases 发布地址查看配套的版本信息:[@react-native-oh-tpl/react-native-picker Releases](https://github.com/react-native-oh-library/react-native-picker/releases) 。对于未发布到npm的旧版本,请参考[安装指南](/zh-cn/tgz-usage.md)安装tgz包。 +请到三方库相应的 Releases 发布地址查看 Release 配套的版本信息: +| 三方库版本 | 发布信息 | 支持RN版本 | +| ---------- | ------------------------------------------------------------ | ---------- | +| 3.9.1 | [@react-native-oh-tpl/react-native-picker Releases](https://github.com/react-native-oh-library/react-native-picker/releases) | 0.72 | +| 3.9.1 | [@react-native-oh-tpl/react-native-picker Releases]() | 0.77 | + +对于未发布到npm的旧版本,请参考[安装指南](/zh-cn/tgz-usage.md)安装tgz包。 进入到工程目录并输入以下命令: @@ -25,12 +31,14 @@ #### **npm** ```bash +#3.9.1 npm install @react-native-oh-tpl/react-native-picker ``` #### **yarn** ```bash +#3.9.1 yarn add @react-native-oh-tpl/react-native-picker ``` diff --git a/zh-cn/react-native-slider.md b/zh-cn/react-native-slider.md index 12495c6b..e6750c11 100644 --- a/zh-cn/react-native-slider.md +++ b/zh-cn/react-native-slider.md @@ -16,7 +16,13 @@ ## 安装与使用 -请到三方库的 Releases 发布地址查看配套的版本信息:[@react-native-oh-tpl/jeanregisser-react-native-slider Releases](https://github.com/react-native-oh-library/jeanregisser-react-native-slider/releases) 。对于未发布到npm的旧版本,请参考[安装指南](/zh-cn/tgz-usage.md)安装tgz包。 +请到三方库相应的 Releases 发布地址查看 Release 配套的版本信息: +| 三方库版本 | 发布信息 | 支持RN版本 | +| ---------- | ------------------------------------------------------------ | ---------- | +| 0.11.0 |[@react-native-oh-tpl/jeanregisser-react-native-slider Releases](https://github.com/react-native-oh-library/jeanregisser-react-native-slider/releases)| 0.72 | +| 0.11.1 |[@react-native-oh-tpl/jeanregisser-react-native-slider Releases]() | 0.77 | + +对于未发布到npm的旧版本,请参考[安装指南](/zh-cn/tgz-usage.md)安装tgz包。 进入到工程目录并输入以下命令: @@ -25,13 +31,21 @@ #### **npm** ```bash -npm i @react-native-oh-tpl/react-native-slider +#v0.11.0 +npm i @react-native-oh-tpl/react-native-slider@0.11.0 + +#v0.11.1 +npm i @react-native-oh-tpl/react-native-slider@0.11.1 ``` #### **yarn** ```bash -yarn add @react-native-oh-tpl/react-native-slider +#v0.11.0 +yarn add @react-native-oh-tpl/react-native-slider@0.11.0 + +#v0.11.1 +yarn add @react-native-oh-tpl/react-native-slider@0.11.1 ``` diff --git a/zh-cn/react-native-udp.md b/zh-cn/react-native-udp.md index 78e185ee..3e5a9293 100644 --- a/zh-cn/react-native-udp.md +++ b/zh-cn/react-native-udp.md @@ -18,20 +18,35 @@ ## 安装与使用 -请到三方库的 Releases 发布地址查看配套的版本信息:[@react-native-oh-tpl/react-native-udp Releases](https://github.com/react-native-oh-library/react-native-udp/releases) 。对于未发布到npm的旧版本,请参考[安装指南](/zh-cn/tgz-usage.md)安装tgz包。 +请到三方库的 Releases 发布地址查看配套的版本信息: + +| 三方库版本 | 发布信息 | 支持RN版本 | +| ---------- | ------------------------------------------------------------ | ---------- | +| 4.1.7 | [@react-native-oh-tpl/react-native-udp Releases](https://github.com/react-native-oh-library/react-native-udp/releases) | 0.72 | +| 4.1.7 | [@react-native-ohos/react-native-udp Releases]() | 0.77 | + +对于未发布到npm的旧版本,请参考[安装指南](/zh-cn/tgz-usage.md)安装tgz包。 进入到工程目录并输入以下命令: #### **npm** ```bash +# V4.1.7 npm install @react-native-oh-tpl/react-native-udp + +# V4.1.7 +npm install @react-native-ohos/react-native-udp ``` #### **yarn** ```bash +# V4.1.7 yarn add @react-native-oh-tpl/react-native-udp + +# V4.1.7 +yarn add @react-native-ohos/react-native-udp ``` 下面的代码展示了这个库的基本使用场景: @@ -190,6 +205,8 @@ export default App; 打开 `entry/oh-package.json5`,添加以下依赖 +- V4.1.7 + ```json "dependencies": { "@rnoh/react-native-openharmony": "file:../react_native_openharmony", @@ -197,6 +214,15 @@ export default App; } ``` +- V4.1.7 + +```json +"dependencies": { + "@rnoh/react-native-openharmony": "file:../react_native_openharmony", + "@react-native-ohos/react-native-udp": "file:../../node_modules/@react-native-ohos/react-native-udp/harmony/react_native_udp.har" + } +``` + 点击右上角的 `sync` 按钮 或者在终端执行: @@ -219,8 +245,12 @@ ohpm install ```diff ... +// V4.1.7 + import {RNUdpPackage} from '@react-native-oh-tpl/react-native-udp/ts'; +// V4.1.7 ++ import {RNUdpPackage} from '@react-native-ohos/react-native-udp/ts'; + export function createRNPackages(ctx: RNPackageContext): RNPackage[] { return [ new SamplePackage(ctx), @@ -248,9 +278,12 @@ ohpm install 要使用此库,需要使用正确的 React-Native 和 RNOH 版本。另外,还需要使用配套的 DevEco Studio 和 手机 ROM。 -请到三方库相应的 Releases 发布地址查看 Release 配套的版本信息:[@react-native-oh-tpl/react-native-udp Releases](https://github.com/react-native-oh-library/react-native-udp/releases) - +请到三方库相应的 Releases 发布地址查看 Release 配套的版本信息: +| 三方库版本 | 发布信息 | 支持RN版本 | +| ---------- | ------------------------------------------------------------ | ---------- | +| 4.1.7 | [@react-native-oh-tpl/react-native-udp Releases](https://github.com/react-native-oh-library/react-native-udp/releases) | 0.72 | +| 4.1.7 | [@react-native-ohos/react-native-udp Releases]() | 0.77 | ## API -- Gitee