Add an option to omit default props that are empty function callbacks
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 45/100
- issue の種類
- 機能追加
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- javascript, react
- 領域
- frontend
調査の方向性
まず、リポジトリ内で showDefaultProps と filterProps のオプションをたどり、JSX 文字列の生成時にデフォルトの prop 値がどのように比較されるかを調べます。showDefaultProps または別のドキュメント化されたオプションによって空の関数コールバックを省略できる方法を追加し、生成された出力からそれらのコールバックが除外され、他の prop に影響しないことを確認します。
索引モデルが issue の本文から書いたものです。
説明
Often times a callback prop is assigned an empty function (() => {}) as the default value. The showDefaultProps method is simply looking for equality (I believe), so it won't catch a default prop that is just an empty function. In those cases, I had to add some logic in the filterProps property to make those not appear but I don't think this is the best solution and I would love it if the showDefaultProps would catch those as well or if there was another option I can set so those empty functions don't show up in the generated string.
filterProps: value => {
// Omit empty functions (they're likely from default props and `showDefaultProps` doesn't catch those)
if (!isFunction(value)) {
return true;
}
return value.toString() !== '() => {}';
},
- 主要言語
- TypeScript
- スター
- 519
- フォーク
- 88
- 平均マージ
- 3時間 55分
- マージ済み PR(30日)
- 1
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
algolia/react-element-to-jsx-string のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
-
難易度 3/5 1〜2日 初心者へのやさしさ 35/100
-
難易度 3/5 1〜2日 初心者へのやさしさ 25/100
-
難易度 3/5 1〜2日 初心者へのやさしさ 35/100
-
難易度 2/5 1〜3時間 初心者へのやさしさ 35/100
algolia/react-element-to-jsx-string の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
volcengine/OpenViking#8432 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
jupyterlab/eslint-plugin#178 · コメント 2 件 ·
-
bug from-app needs-triage
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
nightly-labs/openbot#16303 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 72/100