Doesn't find HOCs that just wrap & re-export component
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ệ
- javascript, react
- Lĩnh vực
- documentation
Hướng nghiên cứu
Bắt đầu với các ví dụ hello-button.js và button.js, sau đó lần theo resolver findAllComponentDefinitions để xem tại sao một component được import và bọc bởi connect lại bị bỏ sót. Xác nhận thay đổi bằng cách kiểm tra rằng HelloButton được nhận diện là một component, trong khi Button vẫn được phân tích cú pháp chính xác.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Some HOCs aren't correctly parsed when they're just calling a function on an imported component. For example, exporting a HelloButton component that just exports an imported Button component wrapped in redux connect:
hello-button.js:
// @flow
import { connect } from 'react-redux';
import { sayHello } from '../actions/hello';
import Button from '../components/Button';
const mapStateToProps = () => ({
label: 'Say something',
});
const mapDispatchToProps = dispatch => ({
handleClick: () => {
dispatch(sayHello('Hi!!!'));
},
});
// HelloButton
export default connect(mapStateToProps, mapDispatchToProps)(Button);
button.js:
// @flow
import React from 'react';
import './index.css';
type Props = {
label: string,
handleClick: Function
};
const Button = ({ label, handleClick }: Props) =>
<button styleName='button' onClick={handleClick}>{label}</button>
;
export default Button;
Button is properly parsed, but HelloButton is not considered a component, even when using the findAllComponentDefinitions resolver.
- 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ự
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
bcgov/bc-wallet-mobile#4761 · 1 bình luận ·
-
external-issue to-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
-
area-deployment area-integrations triage:bot-seen
Độ khó 2/5 Nửa ngày Mức phù hợp với người mới 86/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
-
refactor
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100