reactjs / reactjs/react.dev

Examples for generating 'Stable, Predictable and Unique' keys

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

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

主要言語
JavaScript
スター
11.8k
フォーク
7.9k
平均マージ
1日 11時間
マージ済み PR(30日)
11

説明

Reconciliation chapter spends a good time explaining why using the index or even Math.random() as a key is a bad idea, proceeding to suggest using an existent id as a key. When there's not an existent id, it's suggested to "add a new ID property to your model or hash some parts of the content to generate a key".

That's a very controversial issue, a lot of people do it wrong. An example of how to do it would make the chapter a lot better. It's an extensive chapter (compared to others) that seems to end up with no code conclusion. 

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

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

はじめの一歩

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

調査の方向性

まず、Reconciliation章の「Recursing On Children」セクションと、一意なキーの生成についてのリンク先の議論を読んでください。既存のidを持たないモデルについて、明確で技術的に妥当な例を決め、その例と説明を使ってその章を更新してください。ガイダンスが不安定なキーに依存せず、よくある落とし穴を扱っていれば完了です。

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

評価

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

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

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