New definition of uncontrolled components?
まだ誰も着手していません。
- 主要言語
- JavaScript
- スター
- 11.8k
- フォーク
- 7.9k
- 平均マージ
- 1日 11時間
- マージ済み PR(30日)
- 11
説明
I was reading the new documentation for useRef, saw an overcomplicated example, made a PR where I wanted to reference the new docs for uncontrolled components, but for some reason the definition has completely changed from the original docs.
In my opinion, the new definition is wrong. An uncontrolled component is a component where the value is not stored by react at all, but rather stored natively in the DOM element.
The new docs state
It is common to call a component with some local state “uncontrolled”. For example, the original Panel component with an isActive state variable is uncontrolled because its parent cannot influence whether the panel is active or not.
The definiton from old docs:
In a controlled component, form data is handled by a React component. The alternative is uncontrolled components, where form data is handled by the DOM itself.
new docs
- https://beta.reactjs.org/learn/sharing-state-between-components#controlled-and-uncontrolled-components
- https://beta.reactjs.org/blog/2018/06/07/you-probably-dont-need-derived-state#recommendation-fully-uncontrolled-component-with-a-key
Old docs:
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
useRef ドキュメント、「Sharing State Between Components」ページ、2018 年の derived-state に関するブログ記事、古い uncontrolled-components ドキュメントにある定義を比較します。用語を統一すべきかどうかを判断し、そのうえで、定義と例に一貫性があるよう、該当するドキュメントとその参照を更新します。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- javascript, react
- 領域
- documentation
- issue の種類
- ドキュメント
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 35/100