reactjs / reactjs/react.dev

Why don't we mention the concept of callBack props in the 'Lifting State Up' page?

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

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

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

説明

There are times the source of the detailed or complete data is best isolated in a child component rather than trying to lift the state up and creating large parent component. The large parent component that has all the state, goes against the concepts of code isolation and separation of concerns,

Given this, why not add a note to https://reactjs.org/docs/lifting-state-up.html that talks about callback props?
There are 3 issues i'm aware of with callback props:

  1. that warning that the parent component is still rendering: solution: launch the event handler code asynchronously
    2): In async functions, after await(), we should check whether the component is still mounted.
    3): whenever a function is passed as a prop it must be frozen and then only added to the useEffect() dependency chain (better to add all dependencies for useEffect rather than ignore the warning)

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

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

はじめの一歩

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

調査の方向性

reactjs.org/docs/lifting-state-up.html の「Lifting State Up」ページから始め、callback props がそのガイダンスとどのように関係するかを確認します。Issue に挙げられている3つの懸念を評価し、正確な注記をページに追加すべきか判断します。ドキュメントに明確で技術的に裏付けられた説明が含まれるか、Issue で提案された追加を理由付きで見送れば完了です。

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

評価

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

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

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