ReqoreLink forwards the isText styling prop to a custom 'as' element (React warning with react-router's Link)

Đang mở
#707 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

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
66/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
react, typescript
Lĩnh vực
frontend

Hướng nghiên cứu

Start with ReqoreLink and trace how its isText styling prop is forwarded when a custom as element is used; the issue does not name the implementation or test files. Check the existing tests for custom as elements and run them before making a change. Done means styled-only props such as isText no longer reach the custom element or its DOM output, and the React warning is covered by a regression test.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

What happens

ReqoreLink with a custom element, e.g. react-router's link:

<ReqoreLink as={Link} to="/blog/some-post" underline={false}>Title</ReqoreLink>

passes Reqore's internal isText styling prop through to the custom element. react-router's Link spreads unknown props onto its <a>, so React warns on every render:

Warning: React does not recognize the `isText` prop on a DOM element. If you intentionally want it to appear in the DOM as a custom attribute, spell it as lowercase `istext` instead.

Seen with @qoretechnologies/reqore 0.77.5 (beta), React 18, react-router-dom 6.

What the landing page needs

The qorus.cloud post cards (src/components/blog/PostCard.tsx in qorus-saas-landing) make the card's title a router link with ReqoreLink as={Link}, as the prop's docs suggest. isText (and any other styled-only prop) should be filtered with shouldForwardProp / a transient $ prop before it reaches a custom as element.

Meanwhile

The landing page wraps react-router's Link in a small adapter that drops isText, marked TODO(reqore) with this issue; it goes away once Reqore filters the prop.

Ngôn ngữ chính
TypeScript
Star
4
Fork
0
Merge trung bình
16 giờ 28 phút
Pull request đã merge (30 ngày)
9

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của qoretechnologies/reqore

Tất cả issue của qoretechnologies/reqore

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.