HOC as a function won't get generated docs
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
- 35/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
- Lĩnh vực
- documentation, tooling
Hướng nghiên cứu
Bắt đầu bằng cách tái hiện ví dụ HOC trong issue và theo dõi cách parser xử lý class của component bên trong. Xác nhận hành vi docgenInfo mong đợi và bổ sung coverage cho thấy prop bổ sung của HOC được nhận diện; báo cáo không nêu file hoặc test hiện có nào.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Similar to #177 but a slightly different scenario...
Given a HOC method like so:
import { bool } from 'prop-types';
const withSomeExtraProps = Wrapped => {
class HigherOrderComponent extends Component {
static propTypes = Object.assign({}, Wrapped.propTypes, {
/**
* This should be picked up in the docgenInfo
*/
anExtraProp: bool,
});
static defaultProps = Object.assign({}, Wrapped.defaultProps, {
anExtraProp: false,
});
// ....the rest of the HOC logic
}
return HigherOrderComponent;
}
export default withSomeExtraProps;
I understand that this wouldn't automatically mean that the export default withSomeExtraProps(Wrapped) wouldn't automatically get the docgenInfo from the HOC added, but I thought individually this HOC would have it's own docgenInfo that I could reference on it's own.
However, it seems the inner component class here doesn't get recognised and parsed. Does the component class need to be exported for the parser to find it?
- 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
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 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ự
-
Browser Waiting for: Product Owner
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 85/100
getsentry/sentry-javascript#24577 · 1 bình luận ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
agilepathway/label-checker#640 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
copse-dev/agent-pane#2953 ·
-
[aw] Upgrade available Đang mởagentic-workflows
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 85/100
githubnext/rig#534 ·
-
automation missing-model model-sync provider:pioneer
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
anomalyco/models.dev#7701 ·