reactjs / reactjs/react.dev

Expand on benefits of lifting state up and clarity on game state

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

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

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

説明

Thank you for this fantastic tutorial! I had a couple suggestions, or clarifying questions regarding the following paragraph under Completing the Game > Lifting State Up:

We may think that Board should just ask each Square for the Square's state. Although this approach is possible in React, we discourage it because the code becomes difficult to understand, susceptible to bugs, and hard to refactor. Instead, the best approach is to store the game's state in the parent Board component instead of in each Square. The Board component can tell each Square what to display by passing a prop, just like we did when we passed a number to each Square.

In the second sentence, reasons are listed for lifting the state up, but it'd be incredibly helpful to have examples of these reasons expanded on, even if that expansion is found outside the tutorial. Because this is for beginners, they'll likely not know why these are valid reasons.

Also, in the sentence that begins, "Instead, the best approach..." it seemed confusing to refer to the "game's state" when the seeming antecedent to this is the square's state (first sentence). I would've expected the sentence to read, "Instead, the best approach is to store the Square's state in the parent Board component." Even though the lowercase in "game's" should make it obvious that the author doesn't have the Game component in mind, it still made it hard to discern the intent since the Square's state and the game's state hadn't been equated. Hope that makes sense!

Thank you again for this incredible tool!

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

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

はじめの一歩

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

調査の方向性

チュートリアルの「Completing the Game > Lifting State Up」セクションから始め、issue で引用されている段落を見直してください。state をリフトアップすることで理解しやすさ、バグへの耐性、リファクタリングがどのように改善されるのかについての説明を拡充し、Square の state がゲームの state とどのように関係するのかを明確にしてください。初心者にも文言が明確で、両方の提案に対応していれば完了です。

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

評価

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

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

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