【发布时间】:2019-05-08 10:10:29
【问题描述】:
您好,我将在我的应用程序中使用 React CircularProgressbar。我按照以下链接中提到的步骤进行操作。
https://github.com/kevinsqi/react-circular-progressbar
我正在使用 Typescript 创建组件,但我收到如下错误和代码。非常感谢。
import * as React from 'react';
import CircularProgressbar from 'react-circular-progressbar';
import 'react-circular-progressbar/dist/styles.css';
export default function CircularProgressBar(props: {percentageVal: number, textVal: string}) {
return (<div>
<CircularProgressbar
percentage={props.percentageVal}
text={props.textVal}
/>
</div>);
}
错误:语义错误 TS2322 Type '{ percent: number;文本:字符串; }' 不可分配给类型 'IntrinsicAttributes & IntrinsicClassAttributes & Readonly'。
【问题讨论】:
标签: reactjs typescript progress-bar react-bootstrap