Handling prop defined in the argument list of stateless components
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 35/100
- issue の種類
- 機能追加
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- javascript, react
- 領域
- documentation, tooling
調査の方向性
まず、react-docgen issue #69 に記載されている動作と、defaultProps の非推奨化に関するリンク先の議論を確認します。次に、コンポーネントの props 抽出のエントリーポイントを見つけ、分割代入された関数引数がどのように扱われるかを確認します。この構文で要求される prop 名と利用可能な型情報を文書化またはサポートできれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Dear all,
I'm struggling to find documentation about handling a case in which you're defining props in the arguments passed to a stateless, functional component, i.e. ES6 destructuring assignment syntax. An example:
const SomeComponent = ({ propA, propB, propC = 'someString', propD = false}) => {}
The most similar to what I'm looking for is https://github.com/reactjs/react-docgen/issues/69.
Now, docgen returns a list of props-defined-as-arguments as long as they have a default value specified, the rest is straight ignored.
My question: is some work being done on this? Any documentation I can find in this regard?
It seems fair and logical that it's hard to infer anything (but the name) from those props that have no explicit default value attributed to them, but as it stands even the types of the props that are initiated in the arguments, are omitted. You just get a stringified value for whatever is passed to them.
Thanks in advance!
Edit: tapped into the discussion on deprecating defaultProps -- https://github.com/reactjs/rfcs/pull/107#issuecomment-644582699
- 主要言語
- TypeScript
- スター
- 3.8k
- フォーク
- 316
- 平均マージ
- 5時間 7分
- マージ済み PR(30日)
- 4
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
reactjs/react-docgen のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
reactjs/react-docgen#1102 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 58/100
reactjs/react-docgen#1134 ·
-
Typescript Status オープン
難易度 5/5 1週間以上 初心者へのやさしさ 20/100
reactjs/react-docgen#1005 · リアクション 4 件 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 48/100
reactjs/react-docgen#997 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 42/100
reactjs/react-docgen#994 · コメント 1 件 ·
reactjs/react-docgen の issue をすべて見る
似ている issue
-
Type/Bug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
OpenNSW/nsw-srilanka#497 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
0xMiden/bridge-portal#132 ·
-
react-doctor severity:warning tech-debt
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
digidem/comapeo-cloud-app#403 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100