跳到主要内容
版本:Next

ViewToken Object Type

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.

Example​

JavaScript
{
item: {key: "key-12"},
key: "key-12",
index: 11,
isViewable: true
}

Keys and values​

index​

Unique numeric identifier assigned to the data element.

当可视元素不是数据数组中的数据项时,此属性可能为 null\),例如 [SectionList`](sectionlist) 的分区标题或分区页脚进入可视区域时。

TypeOptional
numberYes

isViewable​

Specifies if at least some part of list element is visible in the viewport.

TypeOptional
booleanNo

item​

Item data

TypeOptional
anyNo

key​

Key identifier assigned to the data element extracted to the top level.

TypeOptional
stringNo

section​

Item section data when used with SectionList.

TypeOptional
anyYes

Used by​