diff --git a/en/react-native-screens.md b/en/react-native-screens.md index ac221641ee937dd6a95ae3368d4774e1367a69e8..0554ba859fc96510ea25661726bbf2839f0c9716 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 ( + +