【发布时间】:2019-06-06 04:57:44
【问题描述】:
我已经尝试过在 stackoverflow 中找到的其他解决方案,但我可能弄错了什么,因为没有人为我工作。
有人可以帮助纠正这个 ts 错误吗?
错误 TS2604:JSX 元素类型“抽屉”没有任何构造或调用签名。
所有测试都失败
有功能
import React, {Component} from "react";
import Drawer from "@material-ui/core";
import { Scrollbars } from 'react-custom-scrollbars';
const DrawerB = () => (
<Drawer
open={true}
>
<h1>AAAA</h1>
</Drawer>
);
类
class DrawerA extends Component<any, any>{
constructor(props){
super(props)
}
render(){
return (
<Drawer
open={true}
>
<h1>AAAA</h1>
</Drawer>
)
}
}
有类和无构造
class DrawerC extends Component<any, any>{
render(){
return (
<Drawer
open={true}
>
<h1>AAAA</h1>
</Drawer>
)
}
}
【问题讨论】:
-
你想做什么?你能在 stakcblitz 中创建演示吗?
标签: reactjs typescript