reactjs / reactjs/react-docgen
react-docgen is not compatible with react-like libraries
オープン
まだ誰も着手していません。
improvement
needs-discussion
- 主要言語
- TypeScript
- スター
- 3.8k
- フォーク
- 316
- 平均マージ
- 5時間 7分
- マージ済み PR(30日)
- 4
説明
There are some react-like libraries such as react-lite, preact-compat and other which use API of React for components including PropTypes. All react-docgen methods work well with these libraries. But [this module](react-docgen disables work with react-like libraries) disallows using it.
I have a preact-compat component:
import { h, Component, PropTypes } from 'preact-compat';
export default class MyComponent extends Component {
render() {
return <div>{this.props.children}</div>;
}
}
MyComponent.propTypes = {
myProp: PropTypes.func
};
Actual react-docgen returns this value for type of myProp:
{
name: 'custom',
raw: 'PropTypes.func'
}
If I add preact-compat to whitelist react-docgen returns expected result:
{
type: 'func'
}
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
まず、ホワイトリストによってReact系ライブラリを制限しているモジュールを見つけ、次に提供されたpreact-compatコンポーネントで問題を再現します。PropTypes.funcの既存の動作を確認し、期待される出力と比較します。React系ライブラリが明示的にホワイトリストに追加されていなくても同じ型情報を生成すれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- react, typescript
- 領域
- documentation, tooling
- issue の種類
- バグ
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 35/100