React/TypeScript - Connecting components to Zeplin components failed.

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

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
25/100
Loại issue
Lỗi
Độ rõ ràng
Cần làm rõ
Mức độ hoạt động
Đình trệ
Công nghệ
react, typescript
Lĩnh vực
documentation, tooling

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.

Mô tả

typescript

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",
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

Mở hướng dẫn đóng góp

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 reactjs/react-docgen

Tất cả issue của reactjs/react-docgen

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.