Uncaught DOMException: Failed to execute ‘replaceChild‘ on ‘Node‘: The node ......
myFunction = async () => {
...
if (...) {
this.setState({
...
}); // 此处代码报标题错误
}
...
}
于是我把this改为了that,报错就解决了。可能还是箭头函数继承全局的this有问题,之后再看看原因。
myFunction = async () => {
...
const that = this;
i...
原创
2022-01-20 10:13:57 ·
1935 阅读 ·
0 评论