Type error when casting link-like items
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 45/100
- issue の種類
- バグ
- 明瞭さ
- おおむね明確
- 活発さ
- 停滞
- 技術スタック
- react, tailwindcss, typescript
- 領域
- frontend
調査の方向性
SidebarItem と NavbarItem の prop 定義、特に issue に示されている ThemingProps の置き換えから始め、カスタム Link の例と比較します。link のようなコンポーネントを使ってプロジェクトの TypeScript チェックを実行します。to などのベースコンポーネントの prop が型エラーなしで受け入れられれば完了です。
索引モデルが issue の本文から書いたものです。
説明
- I have searched the Issues to see if this bug has already been reported
- I have tested the latest version
Steps to reproduce
Create an element like a SidebarItem or NavbarItem and override the base element. For example, Remix/React Router has a custom Link element that enables client-side routing:
<SidebarItem
as={Link}
to="/settings"
>
Settings
</SidebarItem>
Current behavior
While the code itself works, typescript gives an error like the following:
TS2322: Type '{ children: string; as: ForwardRefExoticComponent<LinkProps & RefAttributes<HTMLAnchorElement>>; to: string; icon: ForwardRefExoticComponent<...>; className: string; }' is not assignable to type 'IntrinsicAttributes & SidebarItemProps & RefAttributes<Element>'.
Property 'to' does not exist on type 'IntrinsicAttributes & SidebarItemProps & RefAttributes<Element>'.
Expected behavior
Typescript should allow passing the base components' props without an error.
Context
Typechecking only.
Note, these components' proptypes previously extended Record<string, unknown>, but that was replaced with ThemeingProps<ComponentTheme>.
For example:
export interface SidebarItemProps extends Omit<ComponentProps<"div">, "ref">,
Record<string, unknown> {}
but this has now been replaced with:
export interface SidebarItemProps extends Omit<ComponentProps<"div">, "ref">, ThemingProps<SidebarItemTheme> { };
- 主要言語
- TypeScript
- スター
- 2.2k
- フォーク
- 504
- 平均マージ
- 19時間 16分
- マージ済み PR(30日)
- 2
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
themesberg/flowbite-react のほかの issue
-
fix(Carousel): can't give dynamic children to Carousel対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープン:bug: bug
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
themesberg/flowbite-react#1469 · コメント 1 件 ·
-
Pagination is broken if there is only one page対応中かも @Mukilan1600 が 1022 日前に担当しました。 オープン:bug: bug confirmed good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
themesberg/flowbite-react#1048 · コメント 7 件 · リアクション 1 件 ·
-
:books: documentation help wanted
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
themesberg/flowbite-react#1696 · コメント 2 件 ·
-
難易度 5/5 1週間以上 初心者へのやさしさ 15/100
themesberg/flowbite-react#1693 ·
-
NavbarCollapse closes when toggling a MegaMenuDropdown on mobile再び着手できるかも @sarthak-11231 が 46 日前に担当しましたが、オープン中のプルリクエストはありません。 オープン
難易度 3/5 1〜2日 初心者へのやさしさ 58/100
themesberg/flowbite-react#1686 · コメント 2 件 ·
themesberg/flowbite-react の issue をすべて見る
似ている issue
-
documentation good first issue roadmap
難易度 1/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
resend/react-email#3876 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
siyuan-note/siyuan#21324 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
dmno-dev/varlock#1279 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
himynameisdave/bsky-profanity-counter#59 ·
メンテナーはふだん 1 日以内に返信