From 4ad8102564724db47aeef44582643bd7fcdca0e1 Mon Sep 17 00:00:00 2001 From: zhyx2 Date: Fri, 11 Apr 2025 10:30:59 +0800 Subject: [PATCH] =?UTF-8?q?docs:=20[Issues:=20#IC09IX]:=20=E4=BF=AE?= =?UTF-8?q?=E6=94=B9react-native-screens=E5=BA=93=E6=8C=87=E5=AF=BC?= =?UTF-8?q?=E6=96=87=E6=A1=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: zhyx2 --- en/react-native-screens.md | 376 +++++++++++++++++++++++++-------- zh-cn/react-native-screens.md | 381 ++++++++++++++++++++++++++-------- 2 files changed, 589 insertions(+), 168 deletions(-) diff --git a/en/react-native-screens.md b/en/react-native-screens.md index ac221641..0554ba85 100644 --- a/en/react-native-screens.md +++ b/en/react-native-screens.md @@ -16,116 +16,294 @@ ## Installation and Usage -Go to the project directory and execute the following instruction: +The HarmonyOS implementation of this library depends on the native code from @react-native-oh-tpl/native and @react-navigation/native-stack and @react-native-oh-tpl/react-native-safe-area-context and @react-native-oh-tpl/react-native-gesture-handler. If this library is included into your HarmonyOS application, there is no need to include it again; you can skip the steps in this section and use it directly. + +If it is not included, follow the guide provided in [@react-native-oh-tpl/native](/en/react-navigation-native.md) and [@react-native-oh-tpl/native-stack](/en/react-navigation-native-stack.md) and [@react-native-oh-tpl/react-native-safe-area-context](/en/react-native-safe-area-context.md) and [@react-native-oh-tpl/react-native-gesture-handler](/en/react-native-gesture-handler.md) to add it to your project. - +Please visit the Releases page of the third-party library to check the corresponding version information: [@react-native-oh-tpl/react-native-screens Releases](https://github.com/react-native-oh-library/react-native-harmony-screens/releases). For older versions that have not been published to npm, please refer to the [Installation Guide](/zh-cn/tgz-usage.md) to install the tgz package. +Go to the project directory and execute the following instruction: #### **npm** ```bash -npm install @react-navigation/native -npm install @react-native-oh-tpl/stack -npm install @react-native-oh-tpl/react-native-safe-area-context -npm install react-native-screens@3.29.0 +npm install @react-native-oh-tpl/react-native-screens ``` #### **yarn** ```bash -yarn add @react-navigation/native -yarn add @react-navigation/stack -yarn add @react-native-oh-tpl/react-native-safe-area-context -yarn add react-native-screens@3.29.0 +npm install @react-native-oh-tpl/react-native-screens ``` - - The following code shows the basic use scenario of the repository: > [!WARNING] The name of the imported repository remains unchanged. ```js -import React from 'react'; -import {ScrollView, Button, View, Text} from 'react-native'; -import {NavigationContainer} from '@react-navigation/native'; -import {createStackNavigator} from '@react-navigation/stack'; +import * as React from 'react'; +import { Button, View } from 'react-native'; +import { NavigationContainer } from '@react-navigation/native'; +import { createNativeStackNavigator } from '@react-navigation/native-stack'; import { enableScreens } from "react-native-screens"; +enableScreens(true); + +function HomeScreen({ navigation }) { + return ( + +