【发布时间】:2021-02-17 09:30:27
【问题描述】:
这是我的代码
import { notification } from "antd";
const openNotificationWithIcon = (type: string, message: string, err: string) => {
if(type == 'success' || type == 'warning')
notification[type] = ({ message: message, description: err}) *//error here*
return;
};
export default openNotificationWithIcon;
但消息有错误
Type '{ message: string; description: string; }' is not assignable to type '((args: ArgsProps) => void) & ((args: ArgsProps) => void)'.
Object literal may only specify known properties, and 'message' does not exist in type '((args: ArgsProps) => void) & ((args: ArgsProps) => void)'
我在 antd 中看到该消息需要 ReactNode 类型,我已修复但没有发生
【问题讨论】: