reactjs / reactjs/react-docgen
Stateless function components without React.createElement or JSX?
まだ誰も着手していません。
- 主要言語
- TypeScript
- スター
- 3.8k
- フォーク
- 316
- 平均マージ
- 5時間 7分
- マージ済み PR(30日)
- 4
説明
react-docgen is unable to find stateless function components that don't contain JSX or React.createElement call expressions.
This might be the case when some helper library is used. This will also fail if the official React.DOM helpers are used (https://github.com/reactjs/react-docgen/pull/71). Another failing case would be if only React components are returned, but React.createElement was never called because the components were wrapped in React.createFactory.
What about adding support for another heuristic, such as having a propTypes property (and to be even more specific, a propTypes property with an object containing React.PropTypes entries).
I'm happy to implement this and add tests if this sounds reasonable to the maintainers.
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
まず、react-docgen における既存のステートレス関数コンポーネントの検出を追跡し、React.createElement を使用するコンポーネントのテストを確認します。提案された propTypes ヒューリスティックを React.DOM ヘルパーおよび React.createFactory のケースと比較します。これらのコンポーネントが既存の検出動作を壊すことなく検出され、テストでサポートされるパターンがカバーされていれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- react, typescript
- 領域
- tooling
- issue の種類
- 機能追加
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 35/100