0
在tryflow试试这个:为什么Flow在我听XHR错误时抱怨?
const xhr = new XMLHttpRequest();
xhr.addEventListener('error', (err: Error) => {
console.log('xhr failed', err);
});
Flow让这个神秘的错误:
call of method `addEventListener`. Function cannot be called on any member of intersection type intersection
投诉消失,如果我不采取err
参数。但我需要这个参数。
我试过了,没有注释err
。我究竟做错了什么?