ViewToken 对象类型
ViewToken object is returned as one of the properties in the onViewableItemsChanged callback (for example, in the FlatList component). It is exported by ViewabilityHelper.js.
示例
JavaScript
{
item: {key: "key-12"},
key: "key-12",
index: 11,
isViewable: true
}
键和值
index
分配给数据元素的唯一数字标识符。
当可视元素不是数据数组中的数据项时,此属性可能为 null,例如 SectionList 的分区标题或分区页脚进入可视区域时。
| 类型 | 可选 |
|---|---|
| number | 是 |
isViewable
指定列表元素的至少一部分是否在视口中可见。
| 类型 | 可选 |
|---|---|
| boolean | 否 |
item
项目数据
| 类型 | 可选 |
|---|---|
| any | 否 |
key
分配给数据元素并提取到顶层的键标识符。
| 类型 | 可选 |
|---|---|
| string | 否 |
section
与 SectionList 一起使用时的项目分区数据。
| 类型 | 可选 |
|---|---|
| any | 是 |