reactjs / reactjs/react-docgen
React/TypeScript - Connecting components to Zeplin components failed.
Đang mở
Chưa có ai nhận issue này.
typescript
- Ngôn ngữ chính
- TypeScript
- Star
- 3.8k
- Fork
- 316
- Merge trung bình
- 5 giờ 7 phút
- Pull request đã merge (30 ngày)
- 4
Mô tả
Seems like I am having issues with ES6 imports, or TypeScript itself?
import React from "react";
import cls from "classnames";
import { IButtonProps } from "./types";
import "./Button.scss";
const baseclass = "button";
const Button = ({
...,
}: IButtonProps) => {
const classes = cls(
baseclass,
className,
...,
);
return (
<button
disabled={disabled}
className={classes}
type={type}
onClick={onClick}>
{children}
</button>
);
};
export default Button;
Results in following output issue:
Connecting components to Zeplin components failed.
Error occurred while processing src/components/atoms/Button/Button.tsx with @zeplin/cli-connect-react-plugin:
/Users/carlbowen/WebstormProjects/note/node_modules/@zeplin/cli-connect-react-plugin/dist/template/base.pug:18
16|
17| mixin propType(name, propType)
> 18| if propType.name === "union"
19| | #{name}={union[
20| +propertyValues(propType.value)
21| | }]
Cannot read property 'name' of undefined
My config file is as follows:
{
"plugins": [
{
"name": "@zeplin/cli-connect-react-plugin"
}
],
"projects": [],
"styleguides": [
"5cd486b18a..."
],
"components": [
{
"path": "src/components/atoms/Button/Button.tsx",
"zeplinNames": [
"Full Logo"
]
}
]
}
API versions in use:
"@zeplin/cli": "^1.0.0",
"@zeplin/cli-connect-react-plugin": "^0.2.3",
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.
Hướng nghiên cứu
Bắt đầu bằng cách tái hiện lỗi kết nối với src/components/atoms/Button/Button.tsx, cấu hình được hiển thị và các phiên bản package @zeplin CLI được liệt kê. Đọc dist/template/base.pug của plugin quanh dòng 18 và kiểm tra metadata của component truyền tới đó; được xem là hoàn tất khi kết nối Zeplin hoàn thành mà không có lỗi propType undefined.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- react, typescript
- Lĩnh vực
- documentation, tooling
- Loại issue
- Lỗi
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Cần làm rõ
- Mức phù hợp với người mới
- 25/100