我正在尝试创建一个模拟来运行我的测试,但是出现以下错误, “无效的回调。具有2个参数的方法上的设置无法调用具有不同数量的参数(1)的回调” 这是我的设置功能
import React from 'react';
import { withStyles } from '@material-ui/core/styles';
import IconDownload from '@material-ui/icons/CloudDownloadTwoTone';
const styles = theme => ({
root: {
},});
class AttachmentViewer extends React.PureComponent {
static propTypes = {
open: PropTypes.bool.isrequired,filename: PropTypes.string.isrequired,filePath: PropTypes.string.isrequired,};
render() {
const { filePath,filename } = this.props;
return (
<div>
<a href={`${filePath}`} download={filename}>
<IconDownload />
</a>
</div>
);
}
}
export default withStyles(styles)(AttachmentViewer);
如果我仅在Factory中使用一个参数,它将正常工作。有人可以帮忙吗?