diff --git a/1224/react-native-intersection-observer.md b/1224/react-native-intersection-observer.md index 8e3369015b650edbf4ce55e64aea497aad0f6ca4..3ed940675654d5922b46a7fa70d0d268cf718946 100644 --- a/1224/react-native-intersection-observer.md +++ b/1224/react-native-intersection-observer.md @@ -80,7 +80,8 @@ export default App; 在下述版本验证通过: -RNOH:0.72.13; SDK:HarmonyOS NEXT Developer Preview1; IDE:DevEco Studio 4.1.3.500; ROM:2.0.0.59; +1.RNOH:0.72.13; SDK:HarmonyOS NEXT Developer Preview1; IDE:DevEco Studio 4.1.3.500; ROM:2.0.0.59; +2.RNOH:0.72.20; SDK:HarmonyOS NEXT Developer Bate1; IDE:DevEco Studio 5.0.3.29; ROM:3.0.0.18(SP32DEVC00E18R4Plog); #### 组件及属性 diff --git a/zh-cn/react-native-intersection-observer.md b/zh-cn/react-native-intersection-observer.md index cf2cd6b8e5de6969df1fbf060d59024e8eee855d..7b799ebf21a2ea6cb7cd0b257a6f76700d42c632 100644 --- a/zh-cn/react-native-intersection-observer.md +++ b/zh-cn/react-native-intersection-observer.md @@ -13,8 +13,8 @@

-> [!TIP] [Github 地址](https://github.com/react-native-oh-library/react-native-intersection-observer/tree/sig) +> [!TIP] [Github 地址](https://github.com/react-native-oh-library/react-native-intersection-observer/tree/sig) ## 安装与使用 请到三方库的 Releases 发布地址查看配套的版本信息:[<@react-native-oh-library/react-native-intersection-observer> Releases](https://github.com/react-native-oh-library/react-native-intersection-observer/releases),并下载适用版本的 tgz 包。 @@ -44,13 +44,13 @@ yarn add @react-native-oh-library/react-native-intersection-observer@file:# > [!WARNING] 使用时 import 的库名不变。 ```tsx -import React, { useRef } from "react"; -import { Text } from "react-native"; +import React, { useRef } from 'react'; +import { Text } from 'react-native'; import { IOScrollView, IOScrollViewController, InView, -} from "react-native-intersection-observer"; +} from 'react-native-intersection-observer'; function App() { const scrollViewRef = useRef(null); @@ -63,7 +63,7 @@ function App() { > Scroll to bottom - console.log("Inview:", inView)}> + console.log('Inview:', inView)}> Plain children are always rendered. Use onChange to monitor state. @@ -76,12 +76,12 @@ export default App; ``` ## 约束与限制 - #### 兼容性 在下述版本验证通过: -RNOH:0.72.13; SDK:HarmonyOS NEXT Developer Preview1; IDE:DevEco Studio 4.1.3.500; ROM:2.0.0.59; +1.RNOH:0.72.13; SDK:HarmonyOS NEXT Developer Preview1; IDE:DevEco Studio 4.1.3.500; ROM:2.0.0.59; +2.RNOH:0.72.20; SDK:HarmonyOS NEXT Developer Bate1; IDE:DevEco Studio 5.0.3.29; ROM:3.0.0.18; #### 组件及属性 @@ -92,6 +92,8 @@ RNOH:0.72.13; SDK:HarmonyOS NEXT Developer Preview1; IDE:DevEco Studio 4.1 如下是已经鸿蒙化的属性: > [!tip] "鸿蒙支持"列为 yes 的属性表示支持鸿蒙平台,并且效果对标"原库平台"列中的 ios 或 android 的效果。 +> +> #### **IOScrollView** **组件** @@ -105,6 +107,8 @@ Props: Inherits [ScrollView Props](https://reactnative.dev/docs/scrollview#props Methods: Inherits [ScrollView Methods](https://reactnative.dev/docs/scrollview#methods) + + #### **IOFlatList** **组件** #### 此组件有以下属性: @@ -117,17 +121,21 @@ Props: Inherits [FlatList Props](https://reactnative.dev/docs/flatlist#props) Methods: Inherits [FlatList Methods](https://reactnative.dev/docs/flatlist#methods) + + #### **InView** **组件** #### 此组件有以下属性: -| Name | Description | Type | Default | Require | HarmonyOS Support | -| ----------- | ----------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------- | ------- | ------- | ----------------- | -| as | `Render the wrapping element as this element. Defaults to `View`.` | `ComponentType` | View | false | yes | -| children | Children expects a plain child, to have the `` deal with the wrapping element. | ReactNode | | true | yes | -| triggerOnce | Only trigger this method once. | boolean | false | false | yes | +| Name | Description | Type | Default | Require | HarmonyOS Support | +| ----------- | ------------------------------------------------------------ | --------------------------- | ------- | ------- | ----------------- | +| as | `Render the wrapping element as this element. Defaults to `View`.` | `ComponentType` | View | false | yes | +| children | Children expects a plain child, to have the `` deal with the wrapping element. | ReactNode | | true | yes | +| triggerOnce | Only trigger this method once. | boolean | false | false | yes | | onChange | Call this function whenever the in view state changes. It will receive the `inView` boolean, alongside the current `IntersectionObserverEntry`. | `(inView: boolean) => void` | | false | yes | + + ## 遗留问题 ## 其他