【发布时间】:2020-02-22 20:24:29
【问题描述】:
我有一个 typescript + react 的项目,我想安装 wix-react 组件,而且我有很多错误
import * as React from "react";
import Button from 'wix-style-react/Button';
export class Greeter extends React.Component<any, any> {
render() {
return (
<Button onClick={() => console.log('thanks for clicking :)')}>
Click me!
</Button>
)
}
}
我遇到的第一个错误是:
找不到模块“wix-style-react/Button”的声明文件。 '/Users/../node_modules/wix-style-react/Button.js' 隐含了一个 'any' 类型。
然后我发现@types/wix-style-react, Next error: jsx element type 'Button' 没有任何构造或调用签名。
不知道怎么安装,告诉我方法
【问题讨论】:
-
有人可以帮忙吗?
-
作为一般说明 -
import React from "react";- 不需要/不想要* as
标签: javascript reactjs typescript