【发布时间】:2018-10-22 17:03:53
【问题描述】:
<SectionList
sections={[{ data: [1, 2] }, { data: [3, 4] }]}
renderItem={({ item, index }) => ...}
renderSectionHeader={({ section, index }, i) => {
console.log(index, i); // both undefined
}}
/>
我想获取renderSectionHeader中的部分索引。
例如。当section.data 为[1, 2] 时index 应为0,当section.data 为[3, 4] 时为1。
除了将索引添加到sections 数据之外,我还能如何做到这一点?
【问题讨论】:
标签: react-native react-native-sectionlist