[Suggestion]: Section from useContext might not be entirely accurate
まだ誰も着手していません。
- 主要言語
- JavaScript
- スター
- 11.8k
- フォーク
- 7.9k
- 平均マージ
- 1日 11時間
- マージ済み PR(30日)
- 11
説明
Summary
There is a paragraph about re-rendering of children when parent re-renders which doesn't seem to be accurate, see below.
Page
Details
Here: https://react.dev/reference/react/useContext#optimizing-re-renders-when-passing-objects-and-functions,
it says in the bottom of the section:
As a result of this change, even if MyApp needs to re-render, the components calling useContext(AuthContext) won’t need to re-render unless currentUser has changed.
This is not entirely true. because if MyApp re-renders, all of its children (including those consuming the context) will re-render by default, regardless if currentUser has changed or not. Unless there was React.memo used - but this is not mentioned in that part of the docs.
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
useContext のリファレンスで「Optimizing re-renders when passing objects and functions」セクションを開き、MyApp の再レンダリングに関する引用文を確認してください。そこに記載されている動作を検証し、その後、再レンダリングが発生する条件が正確になるようドキュメントを修正して、提出前にドキュメントのチェックを実行してください。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- javascript, react
- 領域
- documentation
- issue の種類
- ドキュメント
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 62/100