react / react/react-native-website

Ambiguity on why the index property in ViewToken is marked optional

オープン
#3,637 コメント 4 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

Never gets stale
主要言語
MDX
スター
2.2k
フォーク
6.3k
平均マージ
11時間 37分
マージ済み PR(30日)
19

説明

Description

On the ViewToken page in the docs it shows that the index property is optional. This is not explained in any further detail by the docs.

What is the problem?

It is unclear to me in what situation this property would be null. This object is used as a parameter for the onViewableItemsChanged callback in VirtualizedList so it is in turn also used in both FlatList and SectionList. This makes me think there wouldn't be a situation where index would be null.

How can we address it?

Update the description of the index property on ViewToken to clarify in what situation it could be null.

If anyone knows a resource like an issue in the react-native repo or a from post that discusses this or can explain it to me I can also make a PR to clarify the description on the property.

Why is it important?

It is currently ambiguous why the index property on ViewToken is marked as optional.

Who needs this?

Anyone using the onViewableItemsChanged prop and relies on the indexes of the callback.

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

React Native ドキュメントの ViewToken ページから始め、オプションの index プロパティの説明を確認します。VirtualizedList、FlatList、SectionList で onViewableItemsChanged コールバックによって ViewToken がどのように使用されるかを調べ、その後、null の index が許可される状況を確認します。その状況を説明するようにプロパティの説明を更新し、レンダリングされたドキュメントを確認します。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
react-native
領域
documentation
issue の種類
ドキュメント
難易度
2/5
見積もり時間
1〜3時間
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
38/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。