Adding onViewableItemsChanged to SectionList changes the items passed to each section's keyExtractor
まだ誰も着手していません。
- 主要言語
- C++
- スター
- 127k
- フォーク
- 25.3k
- 平均マージ
- 1日 23時間
- マージ済み PR(30日)
- 4
説明
Description
We wrote a SectionList component where each section defines it's own keyExtractor. One of the sections uses a key from a nested object in each item in the section. It broke when we wanted to add visibility tracking to the section list, and it seems like the section objects are being run through the keyExtractor but only when onViewableItemsChanged prop is provided.
I expect that only items within each section should be run through the section's keyExtractor function, and that the behavior is consistent regardless of what props are provided.
Steps to reproduce
- Open expo snack linked below
- Run it on android or iOS device and observe it works
- Uncomment the
onViewableItemsChangedline from the SectionList and observe the break
React Native Version
0.75.3
Affected Platforms
Runtime - Android, Runtime - iOS
Output of npx react-native info
See expo snack for reproduction
Stacktrace or Logs
Cannot read property 'id' of undefined
Reproducer
https://snack.expo.dev/V1Ad0VTld860Zdt8n-qb7
Screenshots and Videos
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
リンクされた Expo Snack から始め、SectionList の onViewableItemsChanged prop を切り替えて Android または iOS で失敗を再現します。可視性の追跡が section keyExtractor を呼び出す方法を追跡し、その prop の有無にかかわらず、各セクション内のアイテムだけが一貫して渡されることを確認します。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- react-native
- 領域
- mobile
- issue の種類
- バグ
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 42/100