Expand on benefits of lifting state up and clarity on game state
まだ誰も着手していません。
- 主要言語
- 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!
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
チュートリアルの「Completing the Game > Lifting State Up」セクションから始め、issue で引用されている段落を見直してください。state をリフトアップすることで理解しやすさ、バグへの耐性、リファクタリングがどのように改善されるのかについての説明を拡充し、Square の state がゲームの state とどのように関係するのかを明確にしてください。初心者にも文言が明確で、両方の提案に対応していれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- javascript, react
- 領域
- documentation
- issue の種類
- ドキュメント
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 45/100