[Typo]: Code example mistake in useMemo page
オープン
初心者向け
まだ誰も着手していません。
type: typos
- 主要言語
- JavaScript
- スター
- 11.8k
- フォーク
- 7.9k
- 平均マージ
- 1日 11時間
- マージ済み PR(30日)
- 11
説明
Summary
There is a mistake in the ChatRoom example code on the useMemo page, specifically in the 'Preventing an Effect from firing too often' section.
Page
https://react.dev/reference/react/useMemo#preventing-an-effect-from-firing-too-often
Details
There are two mistakes in the ChatRoom example under the 'Preventing an Effect from firing too often' section:
- The line
const options = createOptions()suddenly appears in the code without context. It seems like this should be removed. - In the comment 'Only changes when createOptions changes', the reference to 'createOptions' should be replaced with 'options object'. This is because options is the actual dependency in the useEffect.
Screenshot of typo:
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
React useMemoのリファレンスページを「Preventing an Effect from firing too often」セクションで開き、ChatRoomの例を確認してください。余分なcreateOptions行と依存関係のコメントを確認し、そのうえで例が自己完結しており、文言がoptionsオブジェクトを正確に説明していることを検証してください。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- javascript, react
- 領域
- documentation
- issue の種類
- ドキュメント
- 難易度
- 1/5
- 見積もり時間
- 1時間未満
- 活発さ
- 停滞
- 明瞭さ
- 明確に書かれている
- 初心者へのやさしさ
- 65/100