It may allow beginners to taste the sweetness of not following the rules
オープン
まだ誰も着手していません。
type: documentation
- 主要言語
- JavaScript
- スター
- 11.8k
- フォーク
- 7.9k
- 平均マージ
- 1日 11時間
- マージ済み PR(30日)
- 11
説明
Summary
https://react.dev/learn/queueing-a-series-of-state-updates
The first challenge in this chapter can still work normally even if it is written like this, because it relies on click behavior
async function handleClick() {
setPending(pending + 1);
await delay(3000);
setPending(pending=>pending - 1);
setCompleted(completed=>completed + 1);
}
However, if it is changed to this, it will not work. At this point, we must change setPending(pending + 1) to setPending(pending => pending + 1)
async function handleClick() {
setTimeout(()=> {setPending(pending + 1);}, 1000)
await delay(3000);
setPending(pending=>pending - 1);
setCompleted(completed=>completed + 1);
}
Page
https://react.dev/learn/queueing-a-series-of-state-updates
Details
Perhaps some annotations could be added
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
リンクされている queueing-a-series-of-state-updates ページから始め、最初のチャレンジとその state update の例を確認します。Issue で説明されている遅延した setTimeout バリアントを再現し、その後、functional updater 形式を説明する注釈をどこに入れるべきかを判断します。ページがこのケースについて明確に警告し、チャレンジの内容が理解しやすいままであれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- javascript, react
- 領域
- documentation
- issue の種類
- ドキュメント
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 45/100