reactjs / reactjs/react.dev

Document Controlled vs Uncontrolled Component Design pattern

オープン
#918 コメント 14 件 リアクション 7 件 担当者 0 名 GitHub で見る

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

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

説明

pursuant to this discussion https://twitter.com/dan_abramov/status/1001943857096003584

all react components can be:

  • controlled (no internal state)
  • uncontrolled (internal state)
  • mixed (uncontrolled by default, unless some props are passed to make it controlled)

the current docs on controlled vs uncontrolled: https://reactjs.org/docs/uncontrolled-components.html focus entirely on forms, but this design pattern applies to -all- components. we should document this.

questions

  1. What else should we say in the docs?
  2. do we want to tell people that they can do "mixed control" or do we leave that for people to discover for themselves?
  3. is this the same page as https://reactjs.org/docs/uncontrolled-components.html or is it a separate page?

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

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

はじめの一歩

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

調査の方向性

既存の uncontrolled-components.html ドキュメントとリンク先のディスカッションから始めます。controlled, uncontrolled, and mixed component patterns をこのページに置くべきか、別のページに置くべきかを判断し、ドキュメントで提供すべきガイダンスを決定します。選択したドキュメントがフォーム以外のパターンも明確にカバーし、スコープに関する未解決の質問に答えられれば完了です。

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

評価

技術スタック
react
領域
documentation
issue の種類
ドキュメント
難易度
4/5
見積もり時間
3〜5日
活発さ
停滞
明瞭さ
説明が足りない
初心者へのやさしさ
35/100

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

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