Conversation
|
This pull request is being automatically deployed with Vercel (learn more). 🔍 Inspect: https://vercel.com/react-component/progress/kryv8374w |
| "rc-tools": "9.x", | ||
| "react": "^16.9.0", | ||
| "react-dom": "^16.9.0", | ||
| "typescript": "^3.9.7" |
|
PR 的过去了,push 的一直报错。 |
|
PR 是合到 master 后的 CI, Push 是当前 branch 的 CI。本地 |
| "eslint": "^7.6.0", | ||
| "father": "^2.29.6", | ||
| "np": "^6.5.0", | ||
| "rc-tools": "9.x", |
Codecov Report
@@ Coverage Diff @@
## master #85 +/- ##
===========================================
+ Coverage 84.68% 99.05% +14.37%
===========================================
Files 4 3 -1
Lines 111 106 -5
Branches 24 26 +2
===========================================
+ Hits 94 105 +11
+ Misses 17 1 -16
Continue to review full report at Codecov.
|
|
|
||
| node_js: | ||
| - 10 | ||
| - 12 |
There was a problem hiding this comment.
之前的dialog 和 upload 咋没有覆盖率检查结果显示呢?
| @@ -1,4 +1,4 @@ | |||
| import Progress, { Line, Circle } from './src/'; | |||
| import Progress, { Line, Circle } from './src'; | |||
| @@ -0,0 +1,22 @@ | |||
| import * as React from 'react'; | |||
|
|
|||
| export interface progressProps { | |||
|
@kermit-xuan 帮忙 Review 下~ |
| @@ -2,18 +2,26 @@ | |||
| import React, { useMemo } from 'react'; | |||
There was a problem hiding this comment.
导入 React 的时候最好使用 import * as React from 'React',否则当 tsconfig 未开启 esModuleInterop 选项时,编译会有问题。
| } | ||
|
|
||
| function toArray(symArray) { | ||
| function toArray(symArray: any) { |
There was a problem hiding this comment.
toArray 一个传入 percent?: number | number[];
一个传入 string | string[] | object;
然后 下面 还用这个的返回值
😂 索性就改成 any 了
| } | ||
|
|
||
| const Circle = ({ | ||
| const Circle: React.FC<ProgressProps> = ({ |
| import { ProgressProps } from './interface'; | ||
|
|
||
| const Line = ({ | ||
| const Line: React.FC<ProgressProps> = ({ |
| @@ -2,8 +2,9 @@ | |||
| import React from 'react'; | |||
There was a problem hiding this comment.
导入 React 的时候最好使用 import * as React from 'React',否则当 tsconfig 未开启 esModuleInterop 选项时,编译会有问题。
| import { useRef, useEffect } from 'react'; | ||
| import { StrokeLinecapType } from './interface'; | ||
|
|
||
| export const defaultProps = { |
There was a problem hiding this comment.
defaultProps 最好加上类型 Partial<ProgressProps>,另外 strokeLinecap 应该可以不用 as
| d={pathString} | ||
| strokeLinecap={strokeLinecap} | ||
| stroke={color} | ||
| stroke={color as string} |
There was a problem hiding this comment.
这个 color 的类型有点迷,可以为 string、string[] 和 object,但是没有看见 object 用到。
There was a problem hiding this comment.
object 好像是这种的
{
0%: 'xxx'
50%: 'xxx'
100%: 'xxx',
}
There was a problem hiding this comment.
明白了,Line 和 Circle 用的一个 Props 定义,但是有些字段的类型是有分叉的。
|
我先发一个 minor 版本到 antd 再测测。 |
No description provided.