Type error when casting link-like items
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 45/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- react, tailwindcss, typescript
- Lĩnh vực
- frontend
Hướng nghiên cứu
Bắt đầu từ các định nghĩa prop của SidebarItem và NavbarItem, đặc biệt là phần thay thế ThemingProps được nêu trong issue, rồi so sánh chúng với ví dụ về Link tùy chỉnh. Chạy các kiểm tra TypeScript của dự án với một component có dạng như link; được xem là hoàn tất khi các prop của component cơ sở như to được chấp nhận mà không có lỗi kiểu.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
- 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> { };
- Ngôn ngữ chính
- TypeScript
- Star
- 2.2k
- Fork
- 504
- Merge trung bình
- 19 giờ 16 phút
- Pull request đã merge (30 ngày)
- 2
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của themesberg/flowbite-react
-
fix(Carousel): can't give dynamic children to CarouselCó thể đã có người làm Có pull request liên kết đang mở hoặc đã được merge. Đang mở:bug: bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
themesberg/flowbite-react#1469 · 1 bình luận ·
-
Pagination is broken if there is only one pageCó thể đã có người làm @Mukilan1600 đã nhận 1022 ngày trước. Đang mở:bug: bug confirmed good first issue
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
themesberg/flowbite-react#1048 · 7 bình luận · 1 reaction ·
-
:books: documentation help wanted
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
themesberg/flowbite-react#1696 · 2 bình luận ·
-
Add a QRCode componentĐang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 15/100
themesberg/flowbite-react#1693 ·
-
NavbarCollapse closes when toggling a MegaMenuDropdown on mobileCó thể làm lại được @sarthak-11231 đã nhận 46 ngày trước và không có pull request nào đang mở. Đang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 58/100
themesberg/flowbite-react#1686 · 2 bình luận ·
Tất cả issue của themesberg/flowbite-react
Issue tương tự
-
documentation good first issue roadmap
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 68/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
resend/react-email#3876 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
siyuan-note/siyuan#21324 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
dmno-dev/varlock#1279 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
himynameisdave/bsky-profanity-counter#59 ·
Maintainer thường phản hồi trong vòng 1 ngày