React-query admin wrapper and possibily undefined value with useGetOne
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 45/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 停滞
- 技術スタック
- react, typescript
- 領域
- frontend
調査の方向性
packages/ra-core/src/dataProvider/useGetOne.ts と packages/ra-core/src/types.ts の identifier type から始め、次にそれらの型定義を React Query の enabled オプションと比較します。query が無効な場合に hook が undefined の id を表現できることを確認し、関連する type checks または tests で、その結果生じる型の挙動を検証します。
索引モデルが issue の本文から書いたものです。
説明
According to the React Query documentation, we have the possibility to block the running query thanks to the enabled function if one of our parameter is not defined.
On the documentation sample, we can see userId can be set on the query definition without any issue.
We also have the possibility to use this option from the useGetOne hooks as you specified on the code doc block
However, the typing of the function requires the id to be a valid identifier:
Because of that, we have to cheat by casting the typing of the undefined value, for example:
const { data: userData } = useGetOne<UserRecord>('users', { id: userId || '' }, { enabled: !!userId });
According to me, we should make that param optional to match the react-query implementation.
What do you think?
- 主要言語
- TypeScript
- スター
- 27k
- フォーク
- 5.5k
- 平均マージ
- 1日 3分
- マージ済み PR(30日)
- 32
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
marmelab/react-admin のほかの issue
-
Blank page after logout when the app re-renders `<Admin>` during `authProvider.logout()`対応中かも @fzaninotto が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
marmelab/react-admin#11431 · コメント 2 件 · 担当者 1 名 ·
メンテナーはふだん 1 日以内に返信
-
Pagination: page button aria-labels are not translated on small screens対応中かも @Singmin が 3 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
marmelab/react-admin#11427 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
Add emptyText property to SelectArrayInput対応中かも @kwitykwity が 61 日前に担当しました。 オープンenhancement good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
marmelab/react-admin#10454 · コメント 7 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 1週間以上 初心者へのやさしさ 38/100
marmelab/react-admin#11426 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
-
ra-data-graphql-simple: outdated graphql-ast-types-browser dependency causes npm peer warnings再び着手できるかも @bipul724 が 15 日前に担当しましたが、オープン中のプルリクエストはありません。 オープン
難易度 4/5 3〜5日 初心者へのやさしさ 25/100
marmelab/react-admin#11395 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
marmelab/react-admin の issue をすべて見る
似ている issue
-
clawsweeper:fix-shape-clear clawsweeper:queueable-fix clawsweeper:source-repro impact:auth-provider issue-rating: 🦞 diamond lobster no-stale P1
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
steipete/oracle#614 · コメント 1 件 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
Koenkk/zigbee-herdsman-converters#13656 ·
メンテナーはふだん 2 日以内に返信
-
check:passed streams:remove
難易度 1/5 1時間未満 初心者へのやさしさ 62/100
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 88/100
メンテナーはふだん 1 日以内に返信
-
bug needs triage
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
actions/setup-node#1659 ·
メンテナーはふだん 1 日以内に返信