From 4b048eb09ed08483d27622c18659b511368822ad Mon Sep 17 00:00:00 2001 From: yp9522 Date: Tue, 16 Dec 2025 17:04:31 +0800 Subject: [PATCH] docs: update usage-docs Signed-off-by: yp9522 --- en/react-native-inappbrowser.md | 5 +++++ zh-cn/react-native-inappbrowser.md | 7 ++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/en/react-native-inappbrowser.md b/en/react-native-inappbrowser.md index aff3304cb..77fc0cbc7 100644 --- a/en/react-native-inappbrowser.md +++ b/en/react-native-inappbrowser.md @@ -47,6 +47,7 @@ The following code shows the basic use scenario of the repository: > [!TIP] The name of the imported repository remains unchanged. ```tsx +// create txs file,For example (BrowserDemo.tsx): import React, { useState } from "react"; import { StyleSheet, @@ -234,6 +235,10 @@ const styles = StyleSheet.create({ }, }); +``` + +```tsx +// create utils.tsx in the same directory as the BrowserDemo.tsx file import { Alert, Platform } from "react-native"; import { InAppBrowser } from "react-native-inappbrowser-reborn"; diff --git a/zh-cn/react-native-inappbrowser.md b/zh-cn/react-native-inappbrowser.md index 4a32a6897..728aaa52e 100644 --- a/zh-cn/react-native-inappbrowser.md +++ b/zh-cn/react-native-inappbrowser.md @@ -46,7 +46,8 @@ yarn add @react-native-ohos/react-native-inappbrowser-reborn > [!TIP] 使用时 import 的库名不变。 -``` +```tsx +// 创建txs文件,例如(BrowserDemo.tsx): import React, {useState } from 'react'; import { StyleSheet, Text, Button ,ScrollView,View,StatusBarStyle,} from 'react-native'; import {InAppBrowser} from 'react-native-inappbrowser-reborn' @@ -210,6 +211,10 @@ const styles = StyleSheet.create({ }); +``` + +```tsx +// 在BrowserDemo.tsx文件所在的同一目录下创建utils.tsx文件 import {Alert,Platform,} from 'react-native'; import {InAppBrowser} from 'react-native-inappbrowser-reborn' -- Gitee