styled-components and Glamorous support
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 42/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- javascript, react, typescript
- Lĩnh vực
- documentation, tooling
Hướng nghiên cứu
Tái hiện lỗi “No suitable component definition found” đã được báo cáo với các ví dụ styled-components và Glamorous, sau đó kiểm tra react-docgen resolver và thay đổi được tham chiếu bởi #195. Hoàn thành khi cả hai ví dụ đều được nhận diện là các component hợp lệ mà không xuất hiện lỗi đã báo cáo.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Further to this discussion https://github.com/styleguidist/react-styleguidist/issues/37
If you are using styled-components, you may have a component similar to:
import styled, { css } from "styled-components";
import PropTypes from "prop-types";
const Button = styled.a`
background: transparent;
color: white;
${({primary}) =>
!!primary &&
css`
background: white;
color: palevioletred;
`};
`;
Button.propTypes = {
primary: PropTypes.bool
};
export default Button;
or, with Glamorous:
import glamorous from "glamorous";
import PropTypes from "prop-types";
const Button = glamorous.button({
background: "transparent",
color: "white"
},
({ primary }) => (!!primary && {
background: "white",
color: "palevioletred"
})
);
Button.propTypes = {
primary: PropTypes.bool
};
This doesn't import React, so afaik is why the react-docgen resolver does not pick it up as a valid component.
No suitable component definition found.
Is there an existing way to get this to work e.g. with a custom resolver? Or is a bugfix/new feature needed?
#195 looks like it resolves this, and is marked as closed as the feature in v3. I've installed [email protected] but still get the issue with the above 2 examples.
- Ngôn ngữ chính
- TypeScript
- Star
- 3.8k
- Fork
- 316
- Merge trung bình
- 3 giờ 28 phút
- Pull request đã merge (30 ngày)
- 6
Chuẩn bị môi trường
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 reactjs/react-docgen
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
reactjs/react-docgen#1102 ·
-
Typescript StatusĐang mở
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 20/100
reactjs/react-docgen#1005 · 4 reaction ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 48/100
reactjs/react-docgen#997 ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 42/100
reactjs/react-docgen#994 · 1 bình luận ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 25/100
reactjs/react-docgen#982 · 2 bình luận ·
Tất cả issue của reactjs/react-docgen
Issue tương tự
-
ADD openalgoĐang mởtemplate
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
Maintainer thường phản hồi trong vòng 1 ngày
-
factory-active factory-automatic task-bug-reproduction-success task-identify-harness-labels-done task-identify-issue-type-done
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 90/100
vercel/ai#21528 · 3 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug Needs: Triage :mag:
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
microsoft/fluentui-contrib#671 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
sveltejs/acorn-typescript#150 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100